]> git.immae.eu Git - github/bastienwirtz/homer.git/blame - src/components/Service.vue
Implement custom service component
[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",
9a14de00
BW
10 components: {
11 Generic,
12 },
b9c5fcf0
BW
13 props: {
14 item: Object,
15 },
9a14de00
BW
16 computed: {
17 component() {
18 const type = this.item.type || "Generic";
19 if (type == "Generic") {
20 return Generic;
21 }
22 return () => import(`./services/${type}.vue`);
23 },
24 },
b9c5fcf0
BW
25};
26</script>