Skip to content

Commit f37d0ec

Browse files
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
1 parent 8af095f commit f37d0ec

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/packages/__VUE/popup/common.ts

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { computed, ComputedRef, watchEffect, reactive, toRefs, ref } from 'vue';
1+
import { computed, ComputedRef, watchEffect, reactive, toRefs, ref, watch } from 'vue';
22

33
import { popupProps } from './props';
44

@@ -73,11 +73,11 @@ export const component = (componentName: string) => {
7373
const onClickCloseIcon = (e: Event) => {
7474
e.stopPropagation();
7575
emit('click-close-icon', e);
76-
close();
76+
emit('update:visible', false);
77+
// close();
7778
};
7879

7980
const onClickOverlay = (e: Event) => {
80-
console.log('关闭遮罩');
8181
if (props.closeOnClickOverlay) {
8282
emit('click-overlay', e);
8383
emit('update:visible', false);
@@ -93,9 +93,14 @@ export const component = (componentName: string) => {
9393
emit('closed', e);
9494
};
9595

96+
watch(
97+
() => props.visible,
98+
(val) => {
99+
props.visible ? open() : close();
100+
}
101+
);
96102
watchEffect(() => {
97-
console.log('展示popup', props.visible);
98-
props.visible ? open() : close();
103+
// props.visible ? open() : close();
99104
state.closed = props.closeable;
100105
});
101106

0 commit comments

Comments
 (0)