打开弹框清空数据

// 增加弹框
addHandle(){
  this.addVisible = true;
  // 清空表单
  this.$refs.addForm.resetFields();
},

这样子写会报错
在这里插入图片描述
需要使用nextTick

// 增加弹框
addHandle(){
  this.addVisible = true;
  this.$nextTick(() => {
    // 清空表单
    this.$refs.addForm.resetFields();
  })
},
发布了54 篇原创文章 · 获赞 21 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/qq_42816550/article/details/100170245