mirror of
https://gitee.com/wot-design-uni/wot-design-uni.git
synced 2025-12-06 09:08:51 +08:00
feat: ✨ 为 Curtain 组件添加 show-menu-by-longpress 和 close-on-click 属性
✅ Closes: #1279
This commit is contained in:
parent
98d1de8708
commit
a90565510a
@ -96,6 +96,8 @@ function handleClick() {
|
|||||||
| hide-when-close | 是否当关闭时将弹出层隐藏(display: none) | boolean | - | true | - |
|
| hide-when-close | 是否当关闭时将弹出层隐藏(display: none) | boolean | - | true | - |
|
||||||
| z-index | 设置层级 | number | - | 10 | 1.4.0 |
|
| z-index | 设置层级 | number | - | 10 | 1.4.0 |
|
||||||
| root-portal | 是否从页面中脱离出来,用于解决各种 fixed 失效问题 | boolean | - | false | 1.11.0 |
|
| root-portal | 是否从页面中脱离出来,用于解决各种 fixed 失效问题 | boolean | - | false | 1.11.0 |
|
||||||
|
| show-menu-by-longpress | 开启长按图片显示识别小程序码菜单,仅微信小程序支持 | boolean | - | false | $LOWEST_VERSION$ |
|
||||||
|
| close-on-click | 是否在点击图片时关闭幕帘,默认为 true | boolean | - | ture | $LOWEST_VERSION$ |
|
||||||
|
|
||||||
## Events
|
## Events
|
||||||
|
|
||||||
|
|||||||
@ -96,6 +96,8 @@ function handleClick() {
|
|||||||
| hide-when-close | Hide popup layer when closed (display: none) | boolean | - | true | - |
|
| hide-when-close | Hide popup layer when closed (display: none) | boolean | - | true | - |
|
||||||
| z-index | Set layer level | number | - | 10 | 1.4.0 |
|
| z-index | Set layer level | number | - | 10 | 1.4.0 |
|
||||||
| root-portal | Whether to detach from the page, used to solve various fixed positioning issues | boolean | - | false | 1.11.0 |
|
| root-portal | Whether to detach from the page, used to solve various fixed positioning issues | boolean | - | false | 1.11.0 |
|
||||||
|
| show-menu-by-longpress | Enable long press image to show Mini Program code recognition menu, only supported in WeChat Mini Program | boolean | - | false | $LOWEST_VERSION$ |
|
||||||
|
| close-on-click | Whether clicking the image should close the curtain. Defaults to true. | boolean | - | ture | $LOWEST_VERSION$ |
|
||||||
|
|
||||||
## Events
|
## Events
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: weisheng
|
* @Author: weisheng
|
||||||
* @Date: 2025-01-25 23:46:29
|
* @Date: 2025-01-25 23:46:29
|
||||||
* @LastEditTime: 2025-02-13 13:16:45
|
* @LastEditTime: 2025-09-09 10:00:00
|
||||||
* @LastEditors: weisheng
|
* @LastEditors: rusheng
|
||||||
* @Description:
|
* @Description:
|
||||||
* @FilePath: /wot-design-uni/src/uni_modules/wot-design-uni/components/wd-curtain/types.ts
|
* @FilePath: /wot-design-uni/src/uni_modules/wot-design-uni/components/wd-curtain/types.ts
|
||||||
* 记得注释
|
* 记得注释
|
||||||
@ -68,7 +68,15 @@ export const curtainProps = {
|
|||||||
/**
|
/**
|
||||||
* 是否从页面中脱离出来,用于解决各种 fixed 失效问题 (H5: teleport, APP: renderjs, 小程序: root-portal)
|
* 是否从页面中脱离出来,用于解决各种 fixed 失效问题 (H5: teleport, APP: renderjs, 小程序: root-portal)
|
||||||
*/
|
*/
|
||||||
rootPortal: makeBooleanProp(false)
|
rootPortal: makeBooleanProp(false),
|
||||||
|
/**
|
||||||
|
* 开启长按图片显示识别小程序码菜单,仅在微信小程序平台有效
|
||||||
|
*/
|
||||||
|
showMenuByLongpress: makeBooleanProp(false),
|
||||||
|
/**
|
||||||
|
* 点击图片是否关闭幕帘,默认为 true
|
||||||
|
*/
|
||||||
|
closeOnClick: makeBooleanProp(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
export type CurtainProps = ExtractPropTypes<typeof curtainProps>
|
export type CurtainProps = ExtractPropTypes<typeof curtainProps>
|
||||||
|
|||||||
@ -20,7 +20,15 @@
|
|||||||
:custom-style="customStyle"
|
:custom-style="customStyle"
|
||||||
>
|
>
|
||||||
<view class="wd-curtain__content">
|
<view class="wd-curtain__content">
|
||||||
<image :src="src" class="wd-curtain__content-img" :style="imgStyle" @click="clickImage" @error="imgErr" @load="imgLoad"></image>
|
<image
|
||||||
|
:src="src"
|
||||||
|
class="wd-curtain__content-img"
|
||||||
|
:style="imgStyle"
|
||||||
|
:show-menu-by-longpress="showMenuByLongpress"
|
||||||
|
@click="clickImage"
|
||||||
|
@error="imgErr"
|
||||||
|
@load="imgLoad"
|
||||||
|
></image>
|
||||||
<slot name="close">
|
<slot name="close">
|
||||||
<wd-icon
|
<wd-icon
|
||||||
name="close-outline"
|
name="close-outline"
|
||||||
@ -153,7 +161,9 @@ function clickImage() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
emit('click')
|
emit('click')
|
||||||
close()
|
if (props.closeOnClick) {
|
||||||
|
close()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user