Commit f6e4753b by 芋道源码 Committed by Gitee

!414 fix(role): add nextTick for open

Merge pull request !414 from AhJindeg/hotfix-role
parents e8a3745b b5fa1888
...@@ -102,10 +102,12 @@ const open = async (row: RoleApi.RoleVO) => { ...@@ -102,10 +102,12 @@ const open = async (row: RoleApi.RoleVO) => {
formData.name = row.name formData.name = row.name
formData.code = row.code formData.code = row.code
formData.dataScope = row.dataScope formData.dataScope = row.dataScope
await nextTick()
row.dataScopeDeptIds?.forEach((deptId: number): void => {
await nextTick() await nextTick()
// 需要在 DOM 渲染完成后,再设置选中状态 // 需要在 DOM 渲染完成后,再设置选中状态
row.dataScopeDeptIds?.forEach((deptId: number) => { row.dataScopeDeptIds?.forEach((deptId: number): void => {
treeRef.value.setChecked(deptId, true, false) treeRef.value.setChecked(deptId, true, false)
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment