index.vue 801 Bytes
Newer Older
yanzhongrong's avatar
yanzhongrong committed
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
<template>
  <component :is="useEditComponent" :type="type" :curInfo="curInfo" @toUpdate="toUpdate" @cancel="cancel"></component>
</template>

<script>
import Type1 from './type1.vue'
import Type2 from './type2.vue'
import Type3 from './type3.vue'
import Type4 from './type4.vue'
import Type5 from './type5.vue'

export default {
  data() {
    return {
      
    }
  },
  props: {
    type: {
      type: Number,
      defualt: null
    },
    curInfo: {
      type: Object,
      default: () => {}
    }
  },
  computed: {
    useEditComponent() {
      return `Type${this.type}`
    },
  },
  components: {
    Type1,
    Type2,
    Type3,
    Type4,
    Type5,
  },
  methods: {
    toUpdate() {
      this.$emit('toUpdate')
    },
    cancel() {
      this.$emit('cancel')
    },
  }
}
</script>