mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-05-21 22:09:16 +08:00
fix(Field): emit event after setData when input @rex-zsd (#970)
This commit is contained in:
parent
8386f66272
commit
4fbc3434d6
@ -79,11 +79,13 @@ VantComponent({
|
|||||||
methods: {
|
methods: {
|
||||||
onInput(event: Weapp.Event) {
|
onInput(event: Weapp.Event) {
|
||||||
const { value = '' } = event.detail || {};
|
const { value = '' } = event.detail || {};
|
||||||
this.$emit('input', value);
|
|
||||||
this.$emit('change', value);
|
|
||||||
this.setData({
|
this.setData({
|
||||||
value,
|
value,
|
||||||
showClear: this.getShowClear(value)
|
showClear: this.getShowClear(value)
|
||||||
|
}, () => {
|
||||||
|
this.$emit('input', value);
|
||||||
|
this.$emit('change', value);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -120,10 +122,11 @@ VantComponent({
|
|||||||
this.setData({
|
this.setData({
|
||||||
value: '',
|
value: '',
|
||||||
showClear: this.getShowClear('')
|
showClear: this.getShowClear('')
|
||||||
|
}, () => {
|
||||||
|
this.$emit('input', '');
|
||||||
|
this.$emit('change', '');
|
||||||
|
this.$emit('clear', '');
|
||||||
});
|
});
|
||||||
this.$emit('input', '');
|
|
||||||
this.$emit('change', '');
|
|
||||||
this.$emit('clear', '');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onConfirm() {
|
onConfirm() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user