mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
breaking change(Picker): update values param
This commit is contained in:
parent
d42b1b43c3
commit
af7e7fe9df
@ -133,3 +133,7 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Picker 参数调整
|
||||||
|
|
||||||
|
在 Picker 的级联选择下,confirm/change 事件返回的回调参数将包含为完整的选项对象。
|
||||||
|
@ -34,8 +34,6 @@
|
|||||||
show-toolbar
|
show-toolbar
|
||||||
:title="t('title')"
|
:title="t('title')"
|
||||||
:columns="t('cascadeColumns')"
|
:columns="t('cascadeColumns')"
|
||||||
@cancel="onCancel"
|
|
||||||
@confirm="onConfirm"
|
|
||||||
/>
|
/>
|
||||||
</demo-block>
|
</demo-block>
|
||||||
|
|
||||||
|
@ -110,16 +110,7 @@ export default createComponent({
|
|||||||
if (this.dataType === 'text') {
|
if (this.dataType === 'text') {
|
||||||
this.$emit(event, this.getColumnValue(0), this.getColumnIndex(0));
|
this.$emit(event, this.getColumnValue(0), this.getColumnIndex(0));
|
||||||
} else {
|
} else {
|
||||||
let values = this.getValues();
|
this.$emit(event, this.getValues(), this.getIndexes());
|
||||||
|
|
||||||
// compatible with old version of wrong parameters
|
|
||||||
// should be removed in next major version
|
|
||||||
// see: https://github.com/youzan/vant/issues/5905
|
|
||||||
if (this.dataType === 'cascade') {
|
|
||||||
values = values.map((item) => item[this.valueKey]);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$emit(event, values, this.getIndexes());
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -151,16 +142,7 @@ export default createComponent({
|
|||||||
this.getColumnIndex(0)
|
this.getColumnIndex(0)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
let values = this.getValues();
|
this.$emit('change', this, this.getValues(), columnIndex);
|
||||||
|
|
||||||
// compatible with old version of wrong parameters
|
|
||||||
// should be removed in next major version
|
|
||||||
// see: https://github.com/youzan/vant/issues/5905
|
|
||||||
if (this.dataType === 'cascade') {
|
|
||||||
values = values.map((item) => item[this.valueKey]);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$emit('change', this, values, columnIndex);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user