2020-05-26 00:07:03 +02:00
|
|
|
<template>
|
2022-06-04 22:40:48 +02:00
|
|
|
<component :is="component" :item="item" :proxy="proxy"></component>
|
2020-05-26 00:07:03 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-06-04 22:40:48 +02:00
|
|
|
import { defineAsyncComponent } from "vue";
|
2020-10-24 03:16:16 +02:00
|
|
|
import Generic from "./services/Generic.vue";
|
|
|
|
|
2020-05-26 00:07:03 +02:00
|
|
|
export default {
|
|
|
|
name: "Service",
|
|
|
|
props: {
|
|
|
|
item: Object,
|
2021-10-10 09:26:02 +02:00
|
|
|
proxy: Object,
|
2020-05-26 00:07:03 +02:00
|
|
|
},
|
2020-10-24 03:16:16 +02:00
|
|
|
computed: {
|
|
|
|
component() {
|
|
|
|
const type = this.item.type || "Generic";
|
2021-10-06 22:55:09 +02:00
|
|
|
if (type === "Generic") {
|
2020-10-24 03:16:16 +02:00
|
|
|
return Generic;
|
|
|
|
}
|
2022-06-04 22:40:48 +02:00
|
|
|
return defineAsyncComponent(() => import(`./services/${type}.vue`));
|
2020-10-24 03:16:16 +02:00
|
|
|
},
|
|
|
|
},
|
2020-05-26 00:07:03 +02:00
|
|
|
};
|
|
|
|
</script>
|