mirror of
https://github.com/youzan/vant.git
synced 2025-12-24 02:02:09 +08:00
[Doc] update changelog
This commit is contained in:
@@ -127,7 +127,7 @@ When Picker columns data is acquired asynchronously, use `loading` prop to show
|
||||
### API
|
||||
|
||||
| Attribute | Description | Type | Default |
|
||||
|-----------|-----------|-----------|-------------|
|
||||
|------|------|------|------|
|
||||
| columns | Columns data | `Array` | `[]` |
|
||||
| show-toolbar | Whether to show toolbar | `Boolean` | `false` |
|
||||
| title | Toolbar title | `String` | `''` |
|
||||
@@ -142,7 +142,7 @@ When Picker columns data is acquired asynchronously, use `loading` prop to show
|
||||
Picker events will pass different parameters according to the columns are single or multiple
|
||||
|
||||
| Event | Description | Arguments |
|
||||
|-----------|-----------|-----------|
|
||||
|------|------|------|
|
||||
| confirm | Triggered when click confirm button | Single column:current value,current index<br>Multiple columns:current values,current indexes |
|
||||
| cancel | Triggered when click cancel button | Single column:current value,current index<br>Multiple columns:current values,current indexes |
|
||||
| change | Triggered when current option changed | Single column:Picker instance, current value,current index<br>Multiple columns:Picker instance, current values,column index |
|
||||
@@ -151,7 +151,7 @@ Picker events will pass different parameters according to the columns are single
|
||||
### Data struct of columns
|
||||
|
||||
| key | Description |
|
||||
|-----------|-----------|
|
||||
|------|------|
|
||||
| values | Value of column |
|
||||
| defaultIndex | Default value index |
|
||||
| className | ClassName for this column |
|
||||
@@ -161,7 +161,7 @@ Picker events will pass different parameters according to the columns are single
|
||||
Use ref to get picker instance and call instance methods
|
||||
|
||||
| Name | Attribute | Return value | Description |
|
||||
|-----------|-----------|-----------|-------------|
|
||||
|------|------|------|------|
|
||||
| getValues | - | values | Get current values of all columns |
|
||||
| setValues | values | - | Set current values of all columns |
|
||||
| getIndexes | - | indexes | Get current indexes of all columns |
|
||||
|
||||
@@ -128,33 +128,35 @@ export default {
|
||||
|
||||
### API
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|-----------|-----------|-------------|
|
||||
| columns | 对象数组,配置每一列显示的数据 | `Array` | `[]` |
|
||||
| show-toolbar | 是否显示顶部栏 | `Boolean` | `false` |
|
||||
| title | 顶部栏标题 | `String` | `''` |
|
||||
| loading | 是否显示加载状态 | `Boolean` | `false` |
|
||||
| value-key | 选项对象中,文字对应的 key | `String` | `text` |
|
||||
| item-height | 选项高度 | `Number` | `44` |
|
||||
| confirm-button-text | 确认按钮文字 | `String` | `确认` |
|
||||
| cancel-button-text | 取消按钮文字 | `String` | `取消` |
|
||||
| visible-item-count | 可见的选项个数 | `Number` | `5` |
|
||||
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||
|------|------|------|------|------|
|
||||
| columns | 对象数组,配置每一列显示的数据 | `Array` | `[]` | - |
|
||||
| show-toolbar | 是否显示顶部栏 | `Boolean` | `false` | - |
|
||||
| title | 顶部栏标题 | `String` | `''` | - |
|
||||
| loading | 是否显示加载状态 | `Boolean` | `false` | - |
|
||||
| value-key | 选项对象中,文字对应的 key | `String` | `text` | - |
|
||||
| item-height | 选项高度 | `Number` | `44` | - |
|
||||
| confirm-button-text | 确认按钮文字 | `String` | `确认` | - |
|
||||
| cancel-button-text | 取消按钮文字 | `String` | `取消` | - |
|
||||
| visible-item-count | 可见的选项个数 | `Number` | `5` | - |
|
||||
|
||||
### Event
|
||||
|
||||
Picker 组件的事件会根据 columns 是单列或多列返回不同的参数
|
||||
|
||||
| 事件名 | 说明 | 参数 |
|
||||
|-----------|-----------|-----------|
|
||||
|------|------|------|
|
||||
| confirm | 点击完成按钮时触发 | 单列:选中值,选中值对应的索引<br>多列:所有列选中值,所有列选中值对应的索引 |
|
||||
| cancel | 点击取消按钮时触发 | 单列:选中值,选中值对应的索引<br>多列:所有列选中值,所有列选中值对应的索引 |
|
||||
| change | 选项改变时触发 | 单列:Picker 实例,选中值,选中值对应的索引<br>多列:Picker 实例,所有列选中值,当前列对应的索引 |
|
||||
|
||||
|
||||
### Columns 数据结构
|
||||
|
||||
当传入多列数据时,`columns`为一个对象数组,数组中的每一个对象配置每一列,每一列有以下`key`
|
||||
|
||||
| key | 说明 |
|
||||
|-----------|-----------|
|
||||
|------|------|
|
||||
| values | 列中对应的备选值 |
|
||||
| defaultIndex | 初始选中项的索引,默认为 0 |
|
||||
| className | 为对应列添加额外的`class` |
|
||||
@@ -164,7 +166,7 @@ Picker 组件的事件会根据 columns 是单列或多列返回不同的参数
|
||||
通过 ref 可以获取到 picker 实例并调用实例方法
|
||||
|
||||
| 方法名 | 参数 | 返回值 | 介绍 |
|
||||
|-----------|-----------|-----------|-------------|
|
||||
|------|------|------|------|
|
||||
| getValues | - | values | 获取所有列选中的值 |
|
||||
| setValues | values | - | 设置所有列选中的值 |
|
||||
| getIndexes | - | indexes | 获取所有列选中值对应的索引 |
|
||||
@@ -175,12 +177,3 @@ Picker 组件的事件会根据 columns 是单列或多列返回不同的参数
|
||||
| setColumnIndex | columnIndex, optionIndex | - | 设置对应列选中项的索引 |
|
||||
| getColumnValues | columnIndex | values | 获取对应列中所有选项 |
|
||||
| setColumnValue | columnIndex, values | - | 设置对应列中所有选项 |
|
||||
|
||||
### 更新日志
|
||||
|
||||
| 版本 | 类型 | 内容 |
|
||||
|-----------|-----------|-----------|
|
||||
| 1.1.13 | bugfix | 修复部分安卓机型下选项高度错误的问题 |
|
||||
| 1.1.6 | feature | 支持 html 类型的选项 |
|
||||
| 1.1.0 | bugfix | 修复系统字体大小缩放时布局错乱的问题 |
|
||||
| 1.0.4 | feature | 支持 Picker 组件所有属性 |
|
||||
|
||||
Reference in New Issue
Block a user