소스 검색

Popover: fix: delayed popover appears after mouse left

laobubu 8 년 전
부모
커밋
c1ce7a21b9
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      packages/popover/src/main.vue

+ 3 - 2
packages/popover/src/main.vue

@@ -109,16 +109,17 @@ export default {
       this.showPopper = false;
     },
     handleMouseEnter() {
+      clearTimeout(this._timer);
       if (this.openDelay) {
-        setTimeout(() => {
+        this._timer = setTimeout(() => {
           this.showPopper = true;
         }, this.openDelay);
       } else {
         this.showPopper = true;
       }
-      clearTimeout(this._timer);
     },
     handleMouseLeave() {
+      clearTimeout(this._timer);
       this._timer = setTimeout(() => {
         this.showPopper = false;
       }, 200);