]> git.immae.eu Git - github/bastienwirtz/homer.git/blobdiff - src/components/Service.vue
Migrate to VueJS 3
[github/bastienwirtz/homer.git] / src / components / Service.vue
index 868675957a201d59f24578e666cf2ecccf354469..ac378ecf7655c14833c7f4565435587c828fbef2 100644 (file)
@@ -1,25 +1,24 @@
 <template>
-  <component v-bind:is="component" :item="item"></component>
+  <component :is="component" :item="item" :proxy="proxy"></component>
 </template>
 
 <script>
+import { defineAsyncComponent } from "vue";
 import Generic from "./services/Generic.vue";
 
 export default {
   name: "Service",
-  components: {
-    Generic,
-  },
   props: {
     item: Object,
+    proxy: Object,
   },
   computed: {
     component() {
       const type = this.item.type || "Generic";
-      if (type == "Generic") {
+      if (type === "Generic") {
         return Generic;
       }
-      return () => import(`./services/${type}.vue`);
+      return defineAsyncComponent(() => import(`./services/${type}.vue`));
     },
   },
 };