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