fix(SwipeCell): avoid Vue 2.6 event bubble issues (#5348)

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

View File

@ -48,6 +48,10 @@ export default createComponent({
}
},
mounted() {
this.bindTouchEvent(this.$el);
},
methods: {
getWidthByRef(ref) {
if (this.$refs[ref]) {
@ -227,14 +231,7 @@ export default createComponent({
};
return (
<div
class={bem()}
onClick={this.getClickHandler('cell')}
onTouchstart={this.onTouchStart}
onTouchmove={this.onTouchMove}
onTouchend={this.onTouchEnd}
onTouchcancel={this.onTouchEnd}
>
<div class={bem()} onClick={this.getClickHandler('cell')}>
<div class={bem('wrapper')} style={wrapperStyle}>
{this.genLeftPart()}
{this.slots()}