el-tree 的 default-checked-keys 属性默认选中状态bug问题

解决方式:

无需设置 default-checked-keys 属性

  1. 读取到接口数据后使用 this.$refs.tree.setCheckedNodes(***传入接口返回的节点 keys***) 设置默认;
  2. 提交前使用 this.$refs.tree.getCheckedKeys() 再次获取选中的节点并赋值
posted @ 2021-12-01 11:29  Silent-Cxl  阅读(2978)  评论(0)    收藏  举报