From 2c4f32362d4691ad7015d76e180857406b40f1cd Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 28 Mar 2019 20:23:22 +0800 Subject: [PATCH] [bugfix] Picker: render error when set data async (#3064) --- packages/picker/index.js | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/packages/picker/index.js b/packages/picker/index.js index 702ebc7fe..731d0a5e1 100644 --- a/packages/picker/index.js +++ b/packages/picker/index.js @@ -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 (
{Toolbar} - {this.loading && ( + {this.loading ? (
+ ) : ( + h() )}
{columns.map((item, index) => ( @@ -197,10 +191,7 @@ export default sfc({ }} /> ))} -
+
);