Skip to content

Commit cbbc3e9

Browse files
AmyFoxFNdolymood
authored andcommitted
[feat] Popup-based: toggle by v-model (#173)
* feat(popups): use v-model to toggle * [optimize]: abstract visibilityMixin and popupMixin
1 parent 76c2b83 commit cbbc3e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+394
-224
lines changed

document/components/docs/en-US/action-sheet.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ __Notice:__ Cause this component used create-api, so you should read [create-api
143143
| data | the data list to display | Array | - | [] |
144144
| active | the highlighted item's index | Number | - | -1 |
145145
| pickerStyle | Picker style | Boolean | true/false | false |
146+
| visible<sup>1.8.1</sup> | whether visible. Bind to `v-model` | Boolean | true/false | false |
146147

147148
* `data` sub configuration
148149

@@ -158,3 +159,10 @@ __Notice:__ Cause this component used create-api, so you should read [create-api
158159
| - | - | - | - |
159160
| cancel | triggers when clicking the cancel button | - | - |
160161
| select | triggers when clicking some item | the clicked item - data[index] | the index of the clicked item |
162+
163+
### Instance methods
164+
165+
| Method name | Description |
166+
| - | - |
167+
| show | show |
168+
| hide | hide |

document/components/docs/en-US/cascade-picker.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ __Notice:__ Cause this component used create-api, so you should read [create-api
229229
| confirmTxt | the text of the confirm button | String | '确定' | - |
230230
| swipeTime | the duration of the momentum animation when user flicks the wheel of the picker, Unit: ms | Number | 2500 | - |
231231
| alias | configure the alias of `value` and `text`, used as same as the alias of `Picker` component | Object | {} | { value: 'id', text: 'name'} |
232+
| visible<sup>1.8.1</sup> | whether visible. Bind to `v-model` | Boolean | true/false | false |
232233

233234
* `data` sub configuration
234235

@@ -249,4 +250,6 @@ __Notice:__ Cause this component used create-api, so you should read [create-api
249250

250251
| Method name | Description | Parameters 1 | Parameters 2 |
251252
| - | - | - | - |
253+
| show | show | - | - |
254+
| hide | hide | - | - |
252255
| setData | reset the cascading data and selected index | Array, the cascading data | Array, the indexes of selected item in each column |

document/components/docs/en-US/date-picker.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ __Notice:__ Cause this component used create-api, so you should read [create-api
245245
| cancelTxt | the text of the cancel button | String | - | '取消' | - |
246246
| confirmTxt | the text of the confirm button | String | - | '确定' | - |
247247
| swipeTime | the duration of the momentum animation when user flicks the wheel of the picker, Unit: ms | Number | - | 2500 | - |
248-
| alias | configure the alias of `value` and `text` | Object | - | {} | { value: 'id', text: 'name'} |
248+
| visible<sup>1.8.1</sup> | whether visible. Bind to `v-model` | Boolean | true/false | false | - |
249249

250250
* `format` sub configuration
251251

@@ -270,5 +270,5 @@ __Notice:__ Cause this component used create-api, so you should read [create-api
270270

271271
| Method name | Description |
272272
| - | - |
273-
| show | show picker |
274-
| hide | hide picker |
273+
| show | show |
274+
| hide | hide |

document/components/docs/en-US/dialog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ __Notice:__ Cause this component used create-api, so you should read [create-api
161161
| showClose | whether to show close button | Boolean | true/false | false |
162162
| confirmBtn | confirm button configuration | Object/String | - | { text: '确定', active: true, href: 'javascript:;' } |
163163
| cancelBtn | cancel button configuration | Object/String | - | { text: '取消', active: false, href: 'javascript:;' } |
164+
| visible<sup>1.8.1</sup> | whether visible. Bind to `v-model` | Boolean | true/false | false |
164165

165166
* `confirmBtn` sub configuration
166167

@@ -194,3 +195,10 @@ __Notice:__ Cause this component used create-api, so you should read [create-api
194195
| confirm | triggers when the confirm button is clicked | e - event target |
195196
| cancel | triggers when the cancel button is clicked | e - event target |
196197
| close | triggers when the close button is clicked | e - event target |
198+
199+
### Instance methods
200+
201+
| Method name | Description |
202+
| - | - |
203+
| show | show |
204+
| hide | hide |

document/components/docs/en-US/drawer.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ __Notice:__ Drawer component's container element should be be a relative or abso
151151
| title | title | String | - | '' |
152152
| data | data source | Array | - | [] |
153153
| selected-index | initial selected index | Array | - | [] |
154+
| visible<sup>1.8.1</sup> | whether visible. Bind to `v-model` | Boolean | true/false | false |
154155

155156
- `data` sub configuration
156157

@@ -199,6 +200,6 @@ __Notice:__ Drawer component's container element should be be a relative or abso
199200

200201
| Method name | Description | Parameters 1 | Parameters 2 | Parameters 3 |
201202
| - | - | - | - | - |
203+
| refill | refill data, change one Panel's data source | the Panel index | the data source | default selected index (Optional, recommended do not specify a value) |
202204
| show | show | - | - | - |
203205
| hide | hide | - | - | - |
204-
| refill | refill data, change one Panel's data source | the Panel index | the data source | default selected index (Optional, recommended do not specify a value) |

document/components/docs/en-US/picker.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ __Notice:__ Cause this component used create-api, so you should read [create-api
188188
| confirmTxt | the text of the confirm button | String | '确定' | - |
189189
| swipeTime | the duration of the momentum animation when user flicks the wheel of the picker, Unit: ms | Number | 2500 | - |
190190
| alias | configure the alias of `value` and `text` | Object | {} | { value: 'id', text: 'name'} |
191+
| visible<sup>1.8.1</sup> | whether visible. Bind to `v-model` | Boolean | true/false | false |
191192

192193
* `data` sub configuration
193194

@@ -210,5 +211,5 @@ __Notice:__ Cause this component used create-api, so you should read [create-api
210211
| Method name | Description | Parameters 1 | Parameters 2 |
211212
| - | - | - | - |
212213
| setData | set options in picker| Array, texts and values of options of each columns of picker | Array, indexes of selected item in each column of picker |
213-
| show | show picker | - | - |
214-
| hide | hide picker | - | - |
214+
| show | show | - | - |
215+
| hide | hide | - | - |

document/components/docs/en-US/popup.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ __Notice:__ All the components above used create-api, so you should read [create
128128

129129
| Attribute | Description | Type | Accepted Values | Default |
130130
| - | - | - | - | - |
131+
| visible<sup>1.8.1</sup> | whether visible. Bind to `v-model` | Boolean | true/false | false |
131132
| type | the type of popup | String | - | '' |
132133
| mask | whether to show background layer | Boolean | true/false | true |
133134
| content | content, HTML string, valid when there's no slot | String | - | '' |
@@ -138,3 +139,10 @@ __Notice:__ All the components above used create-api, so you should read [create
138139
| Event Name | Description | Parameters |
139140
| - | - | - |
140141
| mask-click | triggers when the background layer is clicked | click event target |
142+
143+
### Instance methods
144+
145+
| Method name | Description |
146+
| - | - |
147+
| show | show |
148+
| hide | hide |

document/components/docs/en-US/segment-picker.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ __Notice:__ Cause this component used create-api, so you should read [create-api
128128
| confirmTxt | the text of the confirm button | String | '确定' | - |
129129
| nextTxt | the text of the next button | String | '下一步' | - |
130130
| prevTxt | the text of the prev button | String | '下一步' | - |
131+
| swipeTime<sup>1.8.1</sup> | the duration of the momentum animation when user flicks the wheel of the picker, Unit: ms | Number | 2500 | - |
132+
| visible<sup>1.8.1</sup> | whether visible. Bind to `v-model` | Boolean | true/false | false |
131133

132134
* `data` sub configuration
133135

@@ -146,10 +148,9 @@ __Notice:__ Cause this component used create-api, so you should read [create-api
146148
| prev | triggers when clicking the prev button | the index of current picker, Number | - | - | - |
147149
| change | triggers when the roller scrolls | pickerIndex: Number, the index of current picker | index: Number, index of current scrolling roller | selectedIndex: Number, index of selected item in current column |
148150

149-
150151
### Methods
151152

152153
| Method name | Description |
153154
| - | - |
154-
| show | show picker |
155-
| hide | hide picker |
155+
| show | show |
156+
| hide | hide |

document/components/docs/en-US/time-picker.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,15 @@ __Notice:__ Cause this component used create-api, so you should read [create-api
143143

144144
| Attribute | Description | Type | Default |
145145
| - | - | - | - |
146-
| title | title | String | '选择时间' |
147-
| swipeTime | the duration of the momentum animation when user flicks the wheel of the picker, Unit: ms | Number | 2500 |
148146
| delay | minutes that postponed backwards from now, which determines the minimal optional time| Number | 15 |
149147
| day | date configuration | Object | { len: 3, filter: ['今日'], format: 'M月d日' } |
150148
| showNow | whether to display current time | Boolean | true |
151149
| minuteStep | step of the minute | Number | 10 |
150+
| title | title | String | '选择时间' |
151+
| cancelTxt<sup>1.8.1</sup> | the text of the cancel button | String | '取消' |
152+
| confirmTxt<sup>1.8.1</sup> | the text of the confirm button | String | '确定' |
153+
| swipeTime | the duration of the momentum animation when user flicks the wheel of the picker, Unit: ms | Number | 2500 |
154+
| visible<sup>1.8.1</sup> | whether visible. Bind to `v-model` | Boolean | false |
152155

153156
* `day` sub configuration
154157

@@ -171,3 +174,5 @@ __Notice:__ Cause this component used create-api, so you should read [create-api
171174
| Method name | Description | Parameters |
172175
| - | - | - |
173176
| setTime | manually set time displayed in time-picker with with the time stamp as time format | time stamp |
177+
| show | show | - |
178+
| hide | hide | - |

document/components/docs/en-US/toast.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,17 @@ __Notice:__ Cause this component used create-api, so you should read [create-api
8787
| mask | whether to show mask layer | Boolean | true/false | false |
8888
| txt | tip text | String | - | '' |
8989
| time | display duration, millisecond | Number | - | 3000 |
90+
| visible<sup>1.8.1</sup> | whether visible. Bind to `v-model` | Boolean | true/false | false |
9091

9192
### Events
9293

9394
| Event Name | Description |
9495
| - | - |
9596
| timeout | triggers when the display time is out |
97+
98+
### Instance methods
99+
100+
| Method name | Description |
101+
| - | - |
102+
| show | show |
103+
| hide | hide |

0 commit comments

Comments
 (0)