breaking change(Area): adjust change event param

This commit is contained in:
chenjiahan 2020-08-21 00:13:27 +08:00
parent 036eb8543c
commit 832dab10cf
4 changed files with 13 additions and 8 deletions

View File

@ -138,3 +138,7 @@ export default {
- 移除 change 事件的第一个参数picker 实例)
- 级联选择下confirm/change 事件返回的回调参数将包含为完整的选项对象。
### Area
- 移除 change 事件的第一个参数picker 实例)

View File

@ -77,7 +77,7 @@ To have a selected valuesimply 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 valuescolumn index |
| change | Triggered when current option changed | current valuescolumn index |
### Slots

View File

@ -73,11 +73,11 @@ app.use(Area);
### Events
| 事件 | 说明 | 回调参数 |
| ------- | ------------------ | ------------------------------------------- |
| confirm | 点击右上方完成按钮 | 一个数组参数,具体格式看下方数据格式章节 |
| cancel | 点击取消按钮时 | - |
| change | 选项改变时触发 | Picker 实例,所有列选中值,当前列对应的索引 |
| 事件 | 说明 | 回调参数 |
| ------- | ------------------ | ---------------------------------------- |
| confirm | 点击右上方完成按钮 | 一个数组参数,具体格式看下方数据格式章节 |
| cancel | 点击取消按钮时 | - |
| change | 选项改变时触发 | 所有列选中值,当前列对应的索引 |
### Slots

View File

@ -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) {