From 00ee00ce989baf9a2260a69616702adf22360daa Mon Sep 17 00:00:00 2001 From: Xiaohui Lam Date: Sat, 18 May 2019 23:15:44 +0800 Subject: [PATCH] fix value binding can't working issue --- components/mpvue-picker/mpvuePicker.vue | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/components/mpvue-picker/mpvuePicker.vue b/components/mpvue-picker/mpvuePicker.vue index dd988296..455ef666 100644 --- a/components/mpvue-picker/mpvuePicker.vue +++ b/components/mpvue-picker/mpvuePicker.vue @@ -78,8 +78,8 @@ pickerValueMulTwoTwo: [], pickerValueMulThreeOne: [], pickerValueMulThreeTwo: [], - pickerValueMulThreeThree: [], - /* 是否显示控件 */ + pickerValueMulThreeThree: [], + /* 是否显示控件 */ showPicker: false, }; }, @@ -92,15 +92,15 @@ /* picker 数值 */ pickerValueArray: { type: Array, - default(){ - return [] + default(){ + return [] } }, /* 默认值 */ pickerValueDefault: { type: Array, - default(){ - return [] + default(){ + return [] } }, /* 几级联动 */ @@ -117,15 +117,17 @@ }, mode(oldVal, newVal) { this.modeChange = true; - }, - pickerValueArray(val){ - this.initPicker(val); + }, + pickerValueArray(val){ + this.initPicker(val); } }, methods: { initPicker(valueArray) { let pickerValueArray = valueArray; - this.pickerValue = this.pickerValueDefault; + setTimeout(() => { + this.pickerValue = this.pickerValueDefault; + }); // 初始化多级联动 if (this.mode === 'selector') { this.pickerValueSingleArray = valueArray; @@ -460,4 +462,4 @@ height: 238px; background-color: rgba(255, 255, 255, 1); } - +