[bugfix] Field: Modified value invalid

This commit is contained in:
Jake 2019-07-26 10:03:37 +08:00 committed by rex
parent 9a3438e891
commit 0601001950

View File

@ -37,9 +37,15 @@ VantComponent({
},
onCancel() {
this.set({ value: '' });
this.$emit('cancel');
this.$emit('change', '');
/**
* 修复修改输入框值时,输入框失焦和赋值同时触发,赋值失效
* // https://github.com/youzan/vant-weapp/issues/1768
*/
setTimeout(() => {
this.set({ value: '' });
this.$emit('cancel');
this.$emit('change', '');
}, 200);
},
onSearch() {