From 702abe38b8ffc02bec085d84a467eb48c7661bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E5=85=88=E7=91=9E?= <1490493387@qq.com> Date: Mon, 17 Jan 2022 23:28:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(user/index.vue):=20watchEffect=E4=BC=9A?= =?UTF-8?q?=E5=9C=A8DOM=E6=8C=82=E8=BD=BD=E6=88=96=E8=80=85=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=B9=8B=E5=89=8D=E5=B0=B1=E4=BC=9A=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=EF=BC=8C=E6=AD=A4=E5=B1=9E=E6=80=A7=E6=8E=A7=E5=88=B6=E5=9C=A8?= =?UTF-8?q?DOM=E5=85=83=E7=B4=A0=E6=9B=B4=E6=96=B0=E5=90=8E=E8=BF=90?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/user/index.vue | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index c370898d..963cd536 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -15,7 +15,7 @@ style="margin-bottom: 20px" /> { - if (state.deptName) { - const tree = unref(treeRef) - tree.filter(state.deptName) - } + const deptTree = unref(deptTreeRef) + deptTree.filter(state.deptName) +}, { + flush: 'post' // watchEffect会在DOM挂载或者更新之前就会触发,此属性控制在DOM元素更新后运行 }) function filterDeptNode(value: string, data: any) { - if (!value) return true + if (!value) { + return true + } return data.label.indexOf(value) !== -1 } @@ -560,7 +562,7 @@ function resetPassword(row: { [key: string]: any }) { confirmButtonText: '确定', cancelButtonText: '取消' }).then(({value}) => { - if(!value){ + if (!value) { ElMessage.warning("请输入新密码") return false } @@ -569,7 +571,7 @@ function resetPassword(row: { [key: string]: any }) { }).then(() => { ElMessage.success('修改成功,新密码是:' + value) }) - }).catch(()=>{ + }).catch(() => { }) }