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

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

</script>
<style>
</style>