nuke-picker
v2.3.12
Published
选择器
Downloads
33
Readme
Picker
- category: UI
- chinese: 选择器
- type: UI Component
Usage
a universal selector && a select component similar to the web. Currently only one-dimensional arrays are supported.
API
Picker.show(options,onSelect,onCancel)
- options params
| Parameter | Description | Type | Default | | :---------- | :-------------------------------------------- | :----- | :------------------------------------ | | title | title | string | | | dataSource | tree structure, or array | array | | | selectedKey | the default value of the Picker(uncontrolled) | number | 0 | | locale | copy of confirm or cancel | object | {cancel: 'cencel',confirm: 'confirm'} |
onNotify:Picker trigger event
onCancel:Picker cancel event
dataSource structure
let data = [ 'Rick' ,'Morty' ,'Hulk' , 'Iron Man' ]
- selectedKey
// 数组索引
selectedKey: 1
Picker.show({
title: 'Please choose',
dataSource: data,
selectedKey: this.state.selected,
hasBottomButton:true, // button at bottom
hasToolbar:true, // header
hasToolbarButton:false,// confirm or cancel button
}, (result) => {
this.setState({
data: data[result.data],
selected: result.data
});
}, (e) => {
console.log('canceled')
});
The Other
- Chat with @翊晨[yichen] in Dingtalk desktop App Download
- DingTalk Group