mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 10:07:07 +00:00
[Improvement] NumberKeyboard: add close event (#1127)
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
v-show="show"
|
||||
:style="style"
|
||||
:class="b([theme])"
|
||||
@touchstart.stop
|
||||
@animationend="onAnimationEnd"
|
||||
@webkitAnimationEnd="onAnimationEnd"
|
||||
>
|
||||
@@ -13,7 +14,7 @@
|
||||
:class="b('close')"
|
||||
v-if="showTitleClose"
|
||||
v-text="closeButtonText"
|
||||
@click="onBlur"
|
||||
@click="onClose"
|
||||
/>
|
||||
</div>
|
||||
<div :class="b('body')">
|
||||
@@ -145,6 +146,11 @@ export default create({
|
||||
this.$emit('blur');
|
||||
},
|
||||
|
||||
onClose() {
|
||||
this.$emit('close');
|
||||
this.onBlur();
|
||||
},
|
||||
|
||||
onAnimationEnd() {
|
||||
this.$emit(this.show ? 'show' : 'hide');
|
||||
},
|
||||
@@ -157,7 +163,7 @@ export default create({
|
||||
if (text === 'delete') {
|
||||
this.$emit('delete');
|
||||
} else if (text === this.closeButtonText) {
|
||||
this.onBlur();
|
||||
this.onClose();
|
||||
} else {
|
||||
this.$emit('input', text);
|
||||
}
|
||||
|
Reference in New Issue
Block a user