when the el-tree related array is returned in the background, the submenus are not all selected, but as long as the id of the parent menu is in the array, then his submenus are all selected
method used
this.$axios.get("menu/queryMenuIdList?roleId=" + row.roleId).then(res => {
this.defalutArr = res.data
this.$refs.tree.setCheckedKeys(this.defalutArr);
})
after reading the document, it is said that as long as the included id in the array returned by the setCheckedKey () method is selected, it will be set to the selected state instead of the semi-selected state. Call for help