Browse Source

fix: close事件触发时机 (#1730)

Sorryhx 3 years ago
parent
commit
91914a22b5
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/packages/__VUE/popup/index.taro.vue
  2. 1 1
      src/packages/__VUE/popup/index.vue

+ 1 - 1
src/packages/__VUE/popup/index.taro.vue

@@ -148,10 +148,10 @@ export default create({
       if (props.visible) {
         unlockScroll();
         emit('update:visible', false);
+        emit('close');
         if (props.destroyOnClose) {
           setTimeout(() => {
             state.showSlot = false;
-            emit('close');
           }, +props.duration * 1000);
         }
       }

+ 1 - 1
src/packages/__VUE/popup/index.vue

@@ -196,10 +196,10 @@ export default create({
     const close = () => {
       unlockScroll();
       emit('update:visible', false);
+      emit('close');
       if (props.destroyOnClose) {
         setTimeout(() => {
           state.showSlot = false;
-          emit('close');
         }, +props.duration * 1000);
       }
     };