解决在mac下面前端代码打包报错的bug

This commit is contained in:
季圣华
2022-11-07 20:55:35 +08:00
parent f3445bab37
commit 2a1db9bbf5

View File

@@ -1,36 +1,37 @@
<template> <template>
<component <component
:is="comp" :is="comp"
:formData="formData" :formData="formData"
ref="compModel" ref="compModel"
v-if="comp"> v-if="comp">
</component> </component>
</template> </template>
<script> <script>
export default { export default {
name: 'DynamicNotice', name: 'DynamicNotice',
data () { data () {
return { return {
compName: this.path compName: this.path
} }
}, },
computed: { computed: {
comp: function () { comp: function () {
if(!this.path){ if(!this.path){
return null; return null
} }
return () => import(`@/views/${this.path}.vue`) return null
} // return () => import(`@/views/${this.path}.vue`)
}, }
props: ['path','formData'], },
methods: { props: ['path','formData'],
detail () { methods: {
setTimeout(() => { detail () {
if(this.path){ setTimeout(() => {
this.$refs.compModel.view(this.formData); if(this.path){
} this.$refs.compModel.view(this.formData);
}, 200) }
}, }, 200)
} },
} }
}
</script> </script>