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