]>
Commit | Line | Data |
---|---|---|
b9c5fcf0 | 1 | <template> |
cbbed634 | 2 | <component :is="component" :item="item" :proxy="proxy"></component> |
b9c5fcf0 BW |
3 | </template> |
4 | ||
5 | <script> | |
cbbed634 | 6 | import { defineAsyncComponent } from "vue"; |
9a14de00 BW |
7 | import Generic from "./services/Generic.vue"; |
8 | ||
b9c5fcf0 BW |
9 | export default { |
10 | name: "Service", | |
11 | props: { | |
12 | item: Object, | |
0a3be103 | 13 | proxy: Object, |
b9c5fcf0 | 14 | }, |
9a14de00 BW |
15 | computed: { |
16 | component() { | |
17 | const type = this.item.type || "Generic"; | |
2ca4faad | 18 | if (type === "Generic") { |
9a14de00 BW |
19 | return Generic; |
20 | } | |
cbbed634 | 21 | return defineAsyncComponent(() => import(`./services/${type}.vue`)); |
9a14de00 BW |
22 | }, |
23 | }, | |
b9c5fcf0 BW |
24 | }; |
25 | </script> |