mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
breaking change(Area): adjust change event param
This commit is contained in:
parent
036eb8543c
commit
832dab10cf
@ -138,3 +138,7 @@ export default {
|
||||
|
||||
- 移除 change 事件的第一个参数(picker 实例)
|
||||
- 级联选择下,confirm/change 事件返回的回调参数将包含为完整的选项对象。
|
||||
|
||||
### Area
|
||||
|
||||
- 移除 change 事件的第一个参数(picker 实例)
|
||||
|
@ -77,7 +77,7 @@ To have a selected value,simply pass the `code` of target area to `value` prop
|
||||
| --- | --- | --- |
|
||||
| confirm | triggers when clicking the confirm button | an array |
|
||||
| cancel | triggers when clicking the cancel button | - |
|
||||
| change | Triggered when current option changed | Picker instance, current values,column index |
|
||||
| change | Triggered when current option changed | current values,column index |
|
||||
|
||||
### Slots
|
||||
|
||||
|
@ -73,11 +73,11 @@ app.use(Area);
|
||||
|
||||
### Events
|
||||
|
||||
| 事件 | 说明 | 回调参数 |
|
||||
| ------- | ------------------ | ------------------------------------------- |
|
||||
| confirm | 点击右上方完成按钮 | 一个数组参数,具体格式看下方数据格式章节 |
|
||||
| cancel | 点击取消按钮时 | - |
|
||||
| change | 选项改变时触发 | Picker 实例,所有列选中值,当前列对应的索引 |
|
||||
| 事件 | 说明 | 回调参数 |
|
||||
| ------- | ------------------ | ---------------------------------------- |
|
||||
| confirm | 点击右上方完成按钮 | 一个数组参数,具体格式看下方数据格式章节 |
|
||||
| cancel | 点击取消按钮时 | - |
|
||||
| change | 选项改变时触发 | 所有列选中值,当前列对应的索引 |
|
||||
|
||||
### Slots
|
||||
|
||||
|
@ -177,12 +177,13 @@ export default createComponent({
|
||||
});
|
||||
},
|
||||
|
||||
onChange(picker, values, index) {
|
||||
onChange(values, index) {
|
||||
const { picker } = this.$refs;
|
||||
this.code = values[index].code;
|
||||
this.setValues();
|
||||
|
||||
const parsedValues = this.parseOutputValues(picker.getValues());
|
||||
this.$emit('change', picker, parsedValues, index);
|
||||
this.$emit('change', parsedValues, index);
|
||||
},
|
||||
|
||||
onConfirm(values, index) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user