59a655c3ee858bec76c4f6e42e6e8528d066be8d.svn-base 652 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <component
  3. :is="comp"
  4. :formData="formData"
  5. ref="compModel"
  6. v-if="comp">
  7. </component>
  8. </template>
  9. <script>
  10. export default {
  11. name: 'DynamicNotice',
  12. data () {
  13. return {
  14. compName: this.path
  15. }
  16. },
  17. computed: {
  18. comp: function () {
  19. if(!this.path){
  20. return null;
  21. }
  22. return () => import(`@/views/${this.path}.vue`)
  23. }
  24. },
  25. props: ['path','formData'],
  26. methods: {
  27. detail () {
  28. setTimeout(() => {
  29. if(this.path){
  30. this.$refs.compModel.view(this.formData);
  31. }
  32. }, 200)
  33. },
  34. }
  35. }
  36. </script>