@@ -177,13 +177,56 @@ __Notice:__ Cause this component used create-api, so you should read [create-api
177177 }
178178 ```
179179
180+ - Subtitle
181+
182+ You could configure subtitle by the property ` subtitle ` .
183+
184+ ``` html
185+ <cube-button @click =" showSubtitlePicker" >Use subtitle</cube-button >
186+ ```
187+ ``` js
188+ const col1Data = [{ text: ' 剧毒' , value: ' 剧毒' }, { text: ' 蚂蚁' , value: ' 蚂蚁' },
189+ { text: ' 幽鬼' , value: ' 幽鬼' }]
190+ export default {
191+ mounted () {
192+ this .subtitlePicker = this .$createPicker ({
193+ title: ' Picker' ,
194+ subtitle: ' subtitle' ,
195+ data: [col1Data],
196+ onSelect: this .selectHandle ,
197+ onCancel: this .cancelHandle
198+ })
199+ },
200+ methods: {
201+ showSubtitlePicker () {
202+ this .subtitlePicker .show ()
203+ },
204+ selectHandle (selectedVal , selectedIndex , selectedText ) {
205+ this .$createDialog ({
206+ type: ' warn' ,
207+ content: ` Selected Item: <br/> - value: ${ selectedVal .join (' , ' )} <br/> - index: ${ selectedIndex .join (' , ' )} <br/> - text: ${ selectedText .join (' ' )} ` ,
208+ icon: ' cubeic-alert'
209+ }).show ()
210+ },
211+ cancelHandle () {
212+ this .$createToast ({
213+ type: ' correct' ,
214+ txt: ' Picker canceled' ,
215+ time: 1000
216+ }).show ()
217+ }
218+ }
219+ }
220+ ```
221+
180222### Props configuration
181223
182224| Attribute | Description | Type | Accepted Values | Default |
183225| - | - | - | - | - |
184- | title | title | String | '' | - |
185226| data | data that passed into picker, whose length determines the columns of picker | Array | [ ] | - |
186227| selectedIndex | the index of the selected value, corresponding content will be displayed when picker shows | Array | [ ] | [ 1] |
228+ | title | title | String | '' | - |
229+ | subtitle<sup >1.8.1</sup > | subtitle | String | '' | - |
187230| cancelTxt | the text of the cancel button | String | '取消' | - |
188231| confirmTxt | the text of the confirm button | String | '确定' | - |
189232| swipeTime | the duration of the momentum animation when user flicks the wheel of the picker, Unit: ms | Number | 2500 | - |
0 commit comments