Browse Source

fix: 组件 popup 组件修改 watcheffect 为 watch (#1883)

* fix: 修复 ImagePreview 在Taro编译成H5后报错的问题

* fix: 地址关闭时, Close 事件触发两次问题解决

* feat: 组件DatePicker 添加双向绑定

* docs: 组件Picker文档修改

* feat: 组件Picker与DatePicker新增属性safe-area-inset-bottom

* feat: imagepreview

* fix: 组件imagepreview点击视频遮罩关闭(#1729)

* fix: 解决 Picker 在微信小程序中无法使用问题 (#1774)

* fix: 修改 Picker 组件 v-model 失效问题

* fix: 组件NoticeBar修改height之后,垂直轮播会卡顿

* fix: 删除Datepicker Demo演示多余内容

* fix: 组件Picker在JD小程序上适配

* fix: 组件Address京东小程序适配

* feat: 京东小程序适配

* fix: 删除空格

* feat: 删除console

* fix: 京东小程序imagepreview适配

* fix: 修复 imagepreview 动态设置 initNo 显示不正确问题

* fix: 组件 InfiniteLoading 某些情况下会错误触发下拉刷新#1819

* fix: 删除pullrefresh

* feat: 组件 imagepreview瘦身

* feat: 组件Picker 瘦身

* fix: address线上问题修改

* fix: 完善imagepreview

* feat: 公共函数提取

* feat: 函数式改用 createComponent

* fix: 文件回撤

* fix: 组件 popup 组件修改 watcheffect 为 watch
yangxiaolu1993 3 years ago
parent
commit
f37d0ec3f2
1 changed files with 10 additions and 5 deletions
  1. 10 5
      src/packages/__VUE/popup/common.ts

+ 10 - 5
src/packages/__VUE/popup/common.ts

@@ -1,4 +1,4 @@
-import { computed, ComputedRef, watchEffect, reactive, toRefs, ref } from 'vue';
+import { computed, ComputedRef, watchEffect, reactive, toRefs, ref, watch } from 'vue';
 
 import { popupProps } from './props';
 
@@ -73,11 +73,11 @@ export const component = (componentName: string) => {
       const onClickCloseIcon = (e: Event) => {
         e.stopPropagation();
         emit('click-close-icon', e);
-        close();
+        emit('update:visible', false);
+        // close();
       };
 
       const onClickOverlay = (e: Event) => {
-        console.log('关闭遮罩');
         if (props.closeOnClickOverlay) {
           emit('click-overlay', e);
           emit('update:visible', false);
@@ -93,9 +93,14 @@ export const component = (componentName: string) => {
         emit('closed', e);
       };
 
+      watch(
+        () => props.visible,
+        (val) => {
+          props.visible ? open() : close();
+        }
+      );
       watchEffect(() => {
-        console.log('展示popup', props.visible);
-        props.visible ? open() : close();
+        // props.visible ? open() : close();
         state.closed = props.closeable;
       });