mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 03:44:48 +00:00
breaking change(Picker): update values param
This commit is contained in:
@@ -34,8 +34,6 @@
|
||||
show-toolbar
|
||||
:title="t('title')"
|
||||
:columns="t('cascadeColumns')"
|
||||
@cancel="onCancel"
|
||||
@confirm="onConfirm"
|
||||
/>
|
||||
</demo-block>
|
||||
|
||||
|
@@ -110,16 +110,7 @@ export default createComponent({
|
||||
if (this.dataType === 'text') {
|
||||
this.$emit(event, this.getColumnValue(0), this.getColumnIndex(0));
|
||||
} else {
|
||||
let values = this.getValues();
|
||||
|
||||
// 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());
|
||||
this.$emit(event, this.getValues(), this.getIndexes());
|
||||
}
|
||||
},
|
||||
|
||||
@@ -151,16 +142,7 @@ export default createComponent({
|
||||
this.getColumnIndex(0)
|
||||
);
|
||||
} else {
|
||||
let values = this.getValues();
|
||||
|
||||
// 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);
|
||||
this.$emit('change', this, this.getValues(), columnIndex);
|
||||
}
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user