44
55## 基本用法
66
7- 通过 ` value ` 属性设置显示隐藏,监听 ` @close ` 事件修改 ` value ` ,必填项。
7+ 通过 ` v-model ` 属性设置显示隐藏,必填项。
88
99` src ` 为幕帘图片地址(只支持在线地址),值为 ` string ` 类型,必填项。
1010
1111` to ` 为幕帘点击访问链接,值为 ` string ` 类型,非必填项。
1212
1313``` html
1414<wd-button @click =" handleClick" >展示幕帘</wd-button >
15- <wd-curtain :value =" value" :src =" img " :to =" link" @close = " handleClose " ></wd-curtain >
15+ <wd-curtain v-model =" value" :src =" img" :to =" link" ></wd-curtain >
1616```
1717
1818``` typescript
@@ -23,10 +23,6 @@ const link = ref<string>('/pages/index/index')
2323function handleClick() {
2424 value .value = true
2525}
26-
27- function handleClose() {
28- value .value = false
29- }
3026```
3127
3228## 设置幕帘图片宽高
@@ -35,7 +31,7 @@ function handleClose() {
3531
3632``` html
3733<wd-button @click =" handleClick" >展示幕帘</wd-button >
38- <wd-curtain :value =" value" :src =" img " :to =" link" @close = " handleClose " width =" 280" ></wd-curtain >
34+ <wd-curtain v-model =" value" :src =" img" :to =" link" width =" 280" ></wd-curtain >
3935```
4036
4137``` typescript
@@ -46,10 +42,6 @@ const link = ref<string>('/pages/index/index')
4642function handleClick() {
4743 value .value = true
4844}
49-
50- function handleClose() {
51- value .value = false
52- }
5345```
5446
5547## 修改关闭按钮位置
@@ -58,7 +50,7 @@ function handleClose() {
5850
5951``` html
6052<wd-button @click =" handleClick" >展示幕帘</wd-button >
61- <wd-curtain :value =" value" :src =" img " :to =" link" @close = " handleClose " close-position =" top" width =" 280" ></wd-curtain >
53+ <wd-curtain v-model =" value" :src =" img" :to =" link" close-position =" top" width =" 280" ></wd-curtain >
6254```
6355
6456``` typescript
@@ -69,10 +61,6 @@ const link = ref<string>('/pages/index/index')
6961function handleClick() {
7062 value .value = true
7163}
72-
73- function handleClose() {
74- value .value = false
75- }
7664```
7765
7866## 设置遮罩点击可关闭幕帘
@@ -81,7 +69,7 @@ function handleClose() {
8169
8270``` html
8371<wd-button @click =" handleClick" >展示幕帘</wd-button >
84- <wd-curtain :value =" value" :src =" img " :to =" link" close-position =" bottom-right" width =" 280" @close = " handleClose " close-on-click-modal ></wd-curtain >
72+ <wd-curtain v-model =" value" :src =" img" :to =" link" close-position =" bottom-right" width =" 280" close-on-click-modal ></wd-curtain >
8573```
8674
8775``` typescript
@@ -92,24 +80,21 @@ const link = ref<string>('/pages/index/index')
9280function handleClick() {
9381 value .value = true
9482}
95-
96- function handleClose() {
97- value .value = false
98- }
9983```
10084
10185## Attributes
10286
103- | 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 |
104- | -------------------- | ----------------------------------------- | ------- | ------------------------------------------------------------------------ | ------ | -------- |
105- | value | 绑定值,展示/关闭幕帘 | boolean | - | - | - |
106- | src | 幕帘图片地址,必须使用网络地址 | string | - | - | - |
107- | width | 幕帘图片宽度,默认单位 px | number | - | - | - |
108- | to | 幕帘图片点击链接 | string | - | - | - |
109- | close-position | 关闭按钮位置 | string | inset / top / bottom / top-left / top-right / bottom-left / bottom-right | inset | - |
110- | close-on-click-modal | 点击遮罩是否关闭 | boolean | - | false | - |
111- | hide-when-close | 是否当关闭时将弹出层隐藏(display: none) | boolean | - | true | - |
112- | z-index | 设置层级 | number | - | 10 | 1.4.0 |
87+ | 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 |
88+ | ----------------------| ----------------------------------------------------| ---------| --------------------------------------------------------------------------| --------| ----------|
89+ | value | 绑定值,展示/关闭幕帘(已废弃,请使用 modelValue) | boolean | - | - | - |
90+ | modelValue | 绑定值,展示/关闭幕帘 | boolean | - | - | $LOWEST_VERSION$ |
91+ | src | 幕帘图片地址,必须使用网络地址 | string | - | - | - |
92+ | width | 幕帘图片宽度,默认单位 px | number | - | - | - |
93+ | to | 幕帘图片点击链接 | string | - | - | - |
94+ | close-position | 关闭按钮位置 | string | inset / top / bottom / top-left / top-right / bottom-left / bottom-right | inset | - |
95+ | close-on-click-modal | 点击遮罩是否关闭 | boolean | - | false | - |
96+ | hide-when-close | 是否当关闭时将弹出层隐藏(display: none) | boolean | - | true | - |
97+ | z-index | 设置层级 | number | - | 10 | 1.4.0 |
11398
11499## Events
115100
0 commit comments