第一次获取数据不会回显,第二次才会回显
两个接口 第一个是获取所有的权限的,第二个是获取已有权限的
我第二次获取才会回显
搞一天了 也没找出来原因.....
主要代码:
async handleChangePower(row) {
this.power = true;
await this.getRolePermisson03();
// this.getRolePermisson03()
this.roleForm.roleId = row.id;
await this.getRolePermisson04();
this.dialogFormVisiblePower = true;
},
getRolePermisson03() {
getPermissionTree().then(res => {
console.log("获取所有权限111", res);
this.cities = res.data.data;
});
},
getRolePermisson04() {
getPermissionIds(this.roleForm).then(res => {
console.log("角色权限", res);
this.$nextTick(() => {
this.checkedCities = res.data.data;
// 数据格式[1,2,3]
});
});
},