weex-nuke
Version:
基于 Rax 、Weex 的高性能组件体系 ~~
71 lines (49 loc) • 1.87 kB
Markdown
select component similar to the web.
Currently only one-dimensional arrays are supported.
- 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
````js
let data = [ 'Rick' ,'Morty' ,'Hulk' , 'Iron Man' ]
````
- selectedKey
````js
// 数组索引
selectedKey: 1
````
````js
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')
});
````
- Chat with <a href="dingtalk://dingtalkclient/action/sendmsg?dingtalk_id=kjwo3w5">@翊晨[yichen]</a> in Dingtalk desktop App <a href='https://tms.dingtalk.com/markets/dingtalk/download'>Download</a>
- DingTalk Group
<img src="https://img.alicdn.com/tfs/TB101EESpXXXXXFXpXXXXXXXXXX-1122-1362.jpg" width="260" />
- category: UI
- chinese: 选择器
- type: UI Component
---
a universal selector && a