44
55一般用于公告类的图片弹窗。
66
7-
87## 基本用法
98
109通过 ` value ` 属性设置显示隐藏,监听 ` @close ` 事件修改 ` value ` ,必填项。
1716<wd-button @click =" handleClick" >展示幕帘</wd-button >
1817<wd-curtain :value =" value" :src =" img " :to =" link" @close =" handleClose" ></wd-curtain >
1918```
20- ``` typescript
19+
20+ ``` typescript
2121const value = ref <boolean >(false )
2222const img = ref <string >(' https://img20.360buyimg.com/da/jfs/t1/141592/25/8861/261559/5f68d8c1E33ed78ab/698ad655bfcfbaed.png' )
2323const link = ref <string >(' /pages/index/index' )
@@ -39,7 +39,8 @@ function handleClose() {
3939<wd-button @click =" handleClick" >展示幕帘</wd-button >
4040<wd-curtain :value =" value" :src =" img " :to =" link" @close =" handleClose" width =" 280" ></wd-curtain >
4141```
42- ``` typescript
42+
43+ ``` typescript
4344const value = ref <boolean >(false )
4445const img = ref <string >(' https://img20.360buyimg.com/da/jfs/t1/141592/25/8861/261559/5f68d8c1E33ed78ab/698ad655bfcfbaed.png' )
4546const link = ref <string >(' /pages/index/index' )
@@ -61,7 +62,8 @@ function handleClose() {
6162<wd-button @click =" handleClick" >展示幕帘</wd-button >
6263<wd-curtain :value =" value" :src =" img " :to =" link" @close =" handleClose" close-position =" top" width =" 280" ></wd-curtain >
6364```
64- ``` typescript
65+
66+ ``` typescript
6567const value = ref <boolean >(false )
6668const img = ref <string >(' https://img20.360buyimg.com/da/jfs/t1/141592/25/8861/261559/5f68d8c1E33ed78ab/698ad655bfcfbaed.png' )
6769const link = ref <string >(' /pages/index/index' )
@@ -83,7 +85,8 @@ function handleClose() {
8385<wd-button @click =" handleClick" >展示幕帘</wd-button >
8486<wd-curtain :value =" value" :src =" img " :to =" link" close-position =" bottom-right" width =" 280" @close =" handleClose" close-on-click-modal ></wd-curtain >
8587```
86- ``` typescript
88+
89+ ``` typescript
8790const value = ref <boolean >(false )
8891const img = ref <string >(' https://img20.360buyimg.com/da/jfs/t1/141592/25/8861/261559/5f68d8c1E33ed78ab/698ad655bfcfbaed.png' )
8992const link = ref <string >(' /pages/index/index' )
@@ -99,36 +102,43 @@ function handleClose() {
99102
100103## Attributes
101104
102- | 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 |
103- | -----| -----| ------| -------| -------| -------- |
104- | value | 绑定值,展示/关闭幕帘 | boolean | - | - | - |
105- | src | 幕帘图片地址,必须使用网络地址 | string | - | - | - |
106- | width | 幕帘图片宽度,默认单位px | number | - | - | - |
107- | to | 幕帘图片点击链接 | string | - | - | - |
108- | close-position | 关闭按钮位置 | string | inset / top / bottom / top-left / top-right / bottom-left / bottom-right | inset | - |
109- | close-on-click-modal | 点击遮罩是否关闭 | boolean | - | false | - |
110- | hide-when-close | 是否当关闭时将弹出层隐藏(display: none) | boolean | - | true | - |
111- | z-index | 设置层级 | number | - | 10 | 1.4.0 |
105+ | 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 |
106+ | -------------------- | ----------------------------------------- | ------- | ------------------------------------------------------------------------ | ------ | -------- |
107+ | value | 绑定值,展示/关闭幕帘 | boolean | - | - | - |
108+ | src | 幕帘图片地址,必须使用网络地址 | string | - | - | - |
109+ | width | 幕帘图片宽度,默认单位 px | number | - | - | - |
110+ | to | 幕帘图片点击链接 | string | - | - | - |
111+ | close-position | 关闭按钮位置 | string | inset / top / bottom / top-left / top-right / bottom-left / bottom-right | inset | - |
112+ | close-on-click-modal | 点击遮罩是否关闭 | boolean | - | false | - |
113+ | hide-when-close | 是否当关闭时将弹出层隐藏(display: none) | boolean | - | true | - |
114+ | z-index | 设置层级 | number | - | 10 | 1.4.0 |
112115
113116## Events
114117
115- | 事件名称 | 说明 | 参数 | 最低版本 |
116- | ---------| -----| -----| ---------|
117- | click | 点击幕帘时触发 | - | - |
118- | close | 弹出层关闭时触发 | - | - |
119- | click-modal | 点击遮罩时触发 | - | - |
120- | beforeenter | 进入前触发 | - | - |
121- | enter | 进入时触发 | - | - |
122- | afterenter | 进入后触发 | - | - |
123- | beforeleave | 离开前触发 | - | - |
124- | leave | 离开时触发 | - | - |
125- | afterleave | 离开后触发| - | - |
126- | load | 图片加载完成事件 | - | - |
127- | error | 图片加载失败事件,若图片加载失败,则不会展示幕帘组件,即使设置 ` value ` 为 true | - | - |
118+ | 事件名称 | 说明 | 参数 | 最低版本 |
119+ | ----------- | ------------------------------------------------------------------------------ | ---- | -------- |
120+ | click | 点击幕帘时触发 | - | - |
121+ | close | 弹出层关闭时触发 | - | - |
122+ | click-modal | 点击遮罩时触发 | - | - |
123+ | beforeenter | 进入前触发 | - | - |
124+ | enter | 进入时触发 | - | - |
125+ | afterenter | 进入后触发 | - | - |
126+ | beforeleave | 离开前触发 | - | - |
127+ | leave | 离开时触发 | - | - |
128+ | afterleave | 离开后触发 | - | - |
129+ | load | 图片加载完成事件 | - | - |
130+ | error | 图片加载失败事件,若图片加载失败,则不会展示幕帘组件,即使设置 ` value ` 为 true | - | - |
131+
132+ ## Slots
133+
134+ | name | 说明 | 最低版本 |
135+ | ----- | ------------ | ---------------- |
136+ | close | 关闭按钮插槽 | $LOWEST_VERSION$ |
128137
129138## 外部样式类
130139
131- | 类名 | 说明 | 最低版本 |
132- | -----| ------| --------|
133- | custom-class | 根节点样式 | - |
134-
140+ | 类名 | 说明 | 最低版本 |
141+ | ------------------ | -------------- | ---------------- |
142+ | custom-class | 根节点样式 | - |
143+ | custom-close-class | 关闭按钮样式类 | $LOWEST_VERSION$ |
144+ | custom-close-style | 关闭按钮样式 | $LOWEST_VERSION$ |
0 commit comments