Skip to content

Commit

Permalink
upd(overlay): 优化组件closeOnClickOverlay属性功能
Browse files Browse the repository at this point in the history
  • Loading branch information
szg2008 committed Mar 6, 2023
1 parent 808ceb5 commit ac70775
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/packages/__VUE/overlay/doc.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,13 @@ Set `close on click override` to control whether the click mask is closed. If it
| overlay-class | Custom mask class name | string | - |
| overlay-style | Custom Mask Style | CSSProperties | - |
| lock-scroll | Whether the background is locked when the mask is displayed | boolean | `true` |
| close-on-click-overlay | Whether to close the mask when clicking. If you set `false`, the `click` event will become invalid | boolean | `true` |
| close-on-click-overlay | Whether to close the mask when clicking. | boolean | `true` |

### Events

| Event | Description | Arguments |
| ------ | ---------- | ------------ |
| click | Triggered when clicked. It only takes effect when `close-on-click-overlay` is `true` | event: MouseEvent |
| click | Triggered when clicked. | event: MouseEvent |

### Slots

Expand Down
4 changes: 2 additions & 2 deletions src/packages/__VUE/overlay/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,13 @@ app.use(Overlay);
| overlay-class | 自定义遮罩类名 | string | - |
| overlay-style | 自定义遮罩样式 | CSSProperties | - |
| lock-scroll | 遮罩显示时的背景是否锁定 | boolean | `true` |
| close-on-click-overlay | 点击遮罩时是否关闭,如果设置 `false`,那么 `click`事件将失效 | boolean | `true` |
| close-on-click-overlay | 点击遮罩时是否关闭 | boolean | `true` |

### Events

| 事件名 | 说明 | 回调参数 |
| ------ | ---------- | ------------ |
| click | 点击时触发,仅当 `close-on-click-overlay``true` 时生效 | event: MouseEvent |
| click | 点击时触发 | event: MouseEvent |

### Slots

Expand Down
4 changes: 2 additions & 2 deletions src/packages/__VUE/overlay/doc.taro.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,13 @@ app.use(Overlay);
| overlay-class | 自定义遮罩类名 | string | - |
| overlay-style | 自定义遮罩样式 | CSSProperties | - |
| lock-scroll | 遮罩显示时的背景是否锁定 | boolean | `true` |
| close-on-click-overlay | 点击遮罩时是否关闭,如果设置 `false`,那么 `click`事件将失效 | boolean | `true` |
| close-on-click-overlay | 点击遮罩时是否关闭 | boolean | `true` |

### Events

| 事件名 | 说明 | 回调参数 |
| ------ | ---------- | ------------ |
| click | 点击时触发,仅当 `close-on-click-overlay``true` 时生效 | event: MouseEvent |
| click | 点击时触发 | event: MouseEvent |

### Slots

Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/overlay/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ export default create({
});
const onClick = (e: MouseEvent) => {
emit('click', e);
if (props.closeOnClickOverlay) {
emit('update:visible', false);
emit('click', e);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/overlay/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ export default create({
});
const onClick = (e: MouseEvent) => {
emit('click', e);
if (props.closeOnClickOverlay) {
emit('update:visible', false);
emit('click', e);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/popup/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ export const component = (componentName: string, components: any) => {
};

const onClickOverlay = (e: Event) => {
emit('click-overlay', e);
if (props.closeOnClickOverlay) {
emit('click-overlay', e);
emit('update:visible', false);
// close();
}
Expand Down

0 comments on commit ac70775

Please sign in to comment.