// el-cascader回显 Deptsearch(object, value, param, children) { for (var key in object) { if (object[key][param] == value) return [object[key][param]] if ( object[key][children] && Object.keys(object[key][children]).length > 0 ) { var temp = this.Deptsearch( object[key][children], value, param, children ) if (temp) return [object[key][param], temp].flat() } } }, const value = this.Deptsearch( this.departmentList, res.data.deptId, 'id', 'children') this.$set(this.equipInfo, 'deptIdList', value) this.equipInfo.deptIdList对应的就是options
标签:el,回显,elementUi,object,param,value,key,children From: https://www.cnblogs.com/goging/p/17187912.html