mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-05-22 06:31:46 +08:00
parent
72e992e56e
commit
a44b3b4ed9
@ -83,7 +83,9 @@ VantComponent({
|
||||
onInput(event: Weapp.Event) {
|
||||
const { value = '' } = event.detail || {};
|
||||
|
||||
this.setData({ value }, () => {
|
||||
this.setData({ value });
|
||||
|
||||
wx.nextTick(() => {
|
||||
this.emitChange(value);
|
||||
});
|
||||
},
|
||||
@ -103,7 +105,9 @@ VantComponent({
|
||||
},
|
||||
|
||||
onClear() {
|
||||
this.setData({ value: '' }, () => {
|
||||
this.setData({ value: '' });
|
||||
|
||||
wx.nextTick(() => {
|
||||
this.emitChange('');
|
||||
this.$emit('clear', '');
|
||||
});
|
||||
@ -116,6 +120,8 @@ VantComponent({
|
||||
emitChange(value) {
|
||||
this.$emit('input', value);
|
||||
this.$emit('change', value);
|
||||
}
|
||||
},
|
||||
|
||||
noop() {}
|
||||
}
|
||||
});
|
||||
|
@ -70,7 +70,7 @@
|
||||
size="16px"
|
||||
name="clear"
|
||||
class="van-field__clear-root van-field__icon-root"
|
||||
bindtouchstart="onClear"
|
||||
catch:touchstart="onClear"
|
||||
/>
|
||||
<view class="van-field__icon-container" bind:tap="onClickIcon">
|
||||
<van-icon
|
||||
|
Loading…
x
Reference in New Issue
Block a user