]> git.immae.eu Git - github/bastienwirtz/homer.git/blob - src/components/Service.vue
Migrate to VueJS 3
[github/bastienwirtz/homer.git] / src / components / Service.vue
1 <template>
2 <component :is="component" :item="item" :proxy="proxy"></component>
3 </template>
4
5 <script>
6 import { defineAsyncComponent } from "vue";
7 import Generic from "./services/Generic.vue";
8
9 export default {
10 name: "Service",
11 props: {
12 item: Object,
13 proxy: Object,
14 },
15 computed: {
16 component() {
17 const type = this.item.type || "Generic";
18 if (type === "Generic") {
19 return Generic;
20 }
21 return defineAsyncComponent(() => import(`./services/${type}.vue`));
22 },
23 },
24 };
25 </script>