浏览代码

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

Sorryhx 3 年之前
父节点
当前提交
91914a22b5
共有 2 个文件被更改,包括 2 次插入2 次删除
  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);
       }
     };