aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components/Service.vue
blob: b3990933b9ea8397684eb03e61860d6093a20482 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<template>
  <component
    v-bind:is="component"
    :item="item"
    :proxy="proxy"
    :forwarder="forwarder"
  ></component>
</template>

<script>
import Generic from "./services/Generic.vue";

export default {
  name: "Service",
  props: {
    item: Object,
    proxy: Object,
    forwarder: Object,
  },
  computed: {
    component() {
      const type = this.item.type || "Generic";
      if (type === "Generic") {
        return Generic;
      }
      return () => import(`./services/${type}.vue`);
    },
  },
};
</script>