homer/src/components/Service.vue

26 lines
527 B
Vue
Raw Normal View History

<template>
2022-06-04 22:40:48 +02:00
<component :is="component" :item="item" :proxy="proxy"></component>
</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";
export default {
name: "Service",
props: {
item: Object,
2021-10-10 09:26:02 +02:00
proxy: Object,
},
2020-10-24 03:16:16 +02:00
computed: {
component() {
const type = this.item.type || "Generic";
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
},
},
};
</script>