fix(NumberKeyboard): avoid Vue 2.6 event bubble issues (#5349)

This commit is contained in:
neverland 2019-12-22 09:51:48 +08:00 committed by GitHub
parent e037082feb
commit c3685ac7c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,6 +38,10 @@ export default createComponent({
}
},
mounted() {
this.bindTouchEvent(this.$el);
},
methods: {
onTouchStart(event) {
// compatible with Vue 2.6 event bubble bug
@ -65,15 +69,7 @@ export default createComponent({
render() {
return (
<i
role="button"
tabindex="0"
class={[BORDER, this.className]}
onTouchstart={this.onTouchStart}
onTouchmove={this.onTouchMove}
onTouchend={this.onTouchEnd}
onTouchcancel={this.onTouchEnd}
>
<i role="button" tabindex="0" class={[BORDER, this.className]}>
{this.slots('default') || this.text}
</i>
);