mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-22 06:31:45 +08:00
fix(NumberKeyboard): avoid Vue 2.6 event bubble issues (#5349)
This commit is contained in:
parent
e037082feb
commit
c3685ac7c1
@ -38,6 +38,10 @@ export default createComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.bindTouchEvent(this.$el);
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onTouchStart(event) {
|
onTouchStart(event) {
|
||||||
// compatible with Vue 2.6 event bubble bug
|
// compatible with Vue 2.6 event bubble bug
|
||||||
@ -65,15 +69,7 @@ export default createComponent({
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<i
|
<i role="button" tabindex="0" class={[BORDER, this.className]}>
|
||||||
role="button"
|
|
||||||
tabindex="0"
|
|
||||||
class={[BORDER, this.className]}
|
|
||||||
onTouchstart={this.onTouchStart}
|
|
||||||
onTouchmove={this.onTouchMove}
|
|
||||||
onTouchend={this.onTouchEnd}
|
|
||||||
onTouchcancel={this.onTouchEnd}
|
|
||||||
>
|
|
||||||
{this.slots('default') || this.text}
|
{this.slots('default') || this.text}
|
||||||
</i>
|
</i>
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user