Skip to content

Commit 9e33ed9

Browse files
committed
fix: modal animation
1 parent b029640 commit 9e33ed9

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

components/modal/Modal.jsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const getClickPosition = e => {
3333

3434
// 只有点击事件支持从鼠标位置动画展开
3535
if (typeof window !== 'undefined' && window.document && window.document.documentElement) {
36-
addEventListener(document.documentElement, 'click', getClickPosition);
36+
addEventListener(document.documentElement, 'click', getClickPosition, true);
3737
}
3838

3939
function noop() {}
@@ -113,10 +113,7 @@ export default {
113113
},
114114
watch: {
115115
visible(val) {
116-
// 点击位置动画 getClickPosition 在 render 后执行,需要延迟触发render
117-
setTimeout(() => {
118-
this.sVisible = val;
119-
});
116+
this.sVisible = val;
120117
},
121118
},
122119
inject: {

0 commit comments

Comments
 (0)