elementui的select下拉框,切换别的下拉框,重置某一个下拉框选中的值

父级下拉框联动下面的表格数据,表格数据属于子数据。
修改上面的下拉框数据,会重新渲染下面的表格数据,有个父子联动关系。

遇到的问题:
表格里面的下拉框之前选中的数据,重新渲染时,发现上一次选中的数据,也带了出来。

解决方案:
先清空表格数据,加上定时器,然后再加入新数据。

_this.tableData = []
setTimeout(() => {
    
    
        _this.loading1 = false
        const arr = JSON.parse(JSON.stringify(_this.arIdOPtions))
        arr.forEach(item => {
    
    
          if (_this.describeForm.arId === item.id) {
    
    
            _this.tableData = item.oaArDetailsVo
          }
        })
      }, 1000);

猜你喜欢

转载自blog.csdn.net/xingchen678/article/details/126344429
今日推荐