如果弹框关闭前有错误提示,弹框重新打开,由于没重新刷新页面,该错误还是存在。。。。
解决办法:弹框中的内容写成一个组件,prop接收父元素弹框的状态,并监听且reset表格
1.
cnpm install import vue-property-decorator --save-dev
2. 子组件.ts
import { Watch } from 'vue-property-decorator';
@Component({ props: { giftConfigShow: { type: Boolean } }, })
@Watch('giftConfigShow') onResetForm(val:number, oldVal:number){ this.$refs['giftConfigure']['resetFields'](); }