[Improvement] NumberKeyboard: add close event (#1127)

This commit is contained in:
neverland
2018-05-21 21:03:04 +08:00
committed by GitHub
parent cf88dda233
commit 88b142a048
4 changed files with 97 additions and 4 deletions

View File

@@ -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);
}