Skip to content

Commit

Permalink
fix(drawer): openDrawer is not normal in some cases
Browse files Browse the repository at this point in the history
修复BasicDrawer在设置其它属性时可能会影响visible状态的问题
  • Loading branch information
mynetfan committed Jun 27, 2021
1 parent d0b6c49 commit 941ad59
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/components/Drawer/src/BasicDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
defineComponent,
ref,
computed,
watchEffect,
watch,
unref,
nextTick,
Expand Down Expand Up @@ -135,9 +134,13 @@
return !!unref(getProps)?.loading;
});
watchEffect(() => {
visibleRef.value = props.visible;
});
watch(
() => props.visible,
(newVal, oldVal) => {
if (newVal != oldVal) visibleRef.value = newVal;
},
{ deep: true }
);
watch(
() => visibleRef.value,
Expand Down

0 comments on commit 941ad59

Please sign in to comment.