<template>
  <div class="inline-16">
    <component :is="formComponent" :data="data" :btnType="btnType" @onSuccess="onSuccess"></component>
  </div>
</template>

<script>
export default {
  props:['formPath','oldFormPath','data','btnType'],
  data () {
    return {
    }
  },
  computed:{
		formComponent(){
      if (this.oldFormPath) {
        return ()=>import(`@/${this.oldFormPath.edit}/edit.vue`)
      } else if (this.formPath) {
        return ()=>import(`@/Form/${this.formPath}/edit.vue`)
      } else {
        return false
      }
		}
	},
  methods:{
    onSuccess () {
      this.$emit('onAddSuccess')
    }
  },
  mounted () {
  }
}

</script>
<style>
</style>