<template>
  <section class="AppDataModel">
    <component :is="currentPage" v-bind="$props"/>
  </section>
</template>

<script>
import DmAdd from "./dmAdd";
import DmList from "./dmList";

export default {
  name: "AppDataModel",
  components: {DmList, DmAdd},
  label: "数据关联模型",
  props: {
    instance: Function,
    dict: Object
  },
  computed: {
    currentPage() {
      let {hash} = this.$route
      return hash == "#add" ? DmAdd : DmList
    }
  },
  created() {
    this.dict.load("detailType")
  }
}
</script>

<style lang="scss" scoped>
.AppDataModel {
  height: 100%;

  & > section {
    height: 100%;
  }
}
</style>
