cpAdd.vue 611 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <div class="inline-16">
  3. <component :is="formComponent" @onSuccess="onSuccess"></component>
  4. </div>
  5. </template>
  6. <script>
  7. export default {
  8. props:['formPath','oldFormPath'],
  9. data () {
  10. return {
  11. }
  12. },
  13. computed:{
  14. formComponent(){
  15. if (this.oldFormPath) {
  16. console.log(this.oldFormPath)
  17. return ()=>import(`@/${this.oldFormPath.add}/add.vue`)
  18. } else {
  19. return ()=>import(`@/Form/${this.formPath}/add.vue`)
  20. }
  21. }
  22. },
  23. methods:{
  24. onSuccess () {
  25. this.$emit('onAddSuccess')
  26. }
  27. },
  28. mounted () {
  29. }
  30. }
  31. </script>
  32. <style>
  33. </style>