mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[bugfix] Picker: render error when set data async (#3064)
This commit is contained in:
parent
28ca59827d
commit
2c4f32362d
@ -57,12 +57,7 @@ export default sfc({
|
||||
|
||||
onChange(columnIndex) {
|
||||
if (this.simple) {
|
||||
this.$emit(
|
||||
'change',
|
||||
this,
|
||||
this.getColumnValue(0),
|
||||
this.getColumnIndex(0)
|
||||
);
|
||||
this.$emit('change', this, this.getColumnValue(0), this.getColumnIndex(0));
|
||||
} else {
|
||||
this.$emit('change', this, this.getValues(), columnIndex);
|
||||
}
|
||||
@ -104,10 +99,7 @@ export default sfc({
|
||||
// set options of column by index
|
||||
setColumnValues(index, options) {
|
||||
const column = this.children[index];
|
||||
if (
|
||||
column &&
|
||||
JSON.stringify(column.options) !== JSON.stringify(options)
|
||||
) {
|
||||
if (column && JSON.stringify(column.options) !== JSON.stringify(options)) {
|
||||
column.options = options;
|
||||
column.setIndex(0);
|
||||
}
|
||||
@ -178,10 +170,12 @@ export default sfc({
|
||||
return (
|
||||
<div class={bem()}>
|
||||
{Toolbar}
|
||||
{this.loading && (
|
||||
{this.loading ? (
|
||||
<div class={bem('loading')}>
|
||||
<Loading />
|
||||
</div>
|
||||
) : (
|
||||
h()
|
||||
)}
|
||||
<div class={bem('columns')} style={columnsStyle} onTouchmove={prevent}>
|
||||
{columns.map((item, index) => (
|
||||
@ -197,10 +191,7 @@ export default sfc({
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
<div
|
||||
class={['van-hairline--top-bottom', bem('frame')]}
|
||||
style={frameStyle}
|
||||
/>
|
||||
<div class={['van-hairline--top-bottom', bem('frame')]} style={frameStyle} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user