From aab238347d108658b535e535c335846fa617fe70 Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 26 Oct 2017 04:06:21 -0500 Subject: [PATCH] [bugfix] Swipe width calc error (#258) * [bugfix] CouponList always show empty info * [bugfix] add click feedback of buttons in components * [Doc] add custom theme document * [new feature] Notice bar support more props * [bugfix] PullRefresh test cases * [bugfix] unused NoticeBar style * [bugfix] Swipe width calc error --- packages/swipe/index.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/swipe/index.vue b/packages/swipe/index.vue index 33a8a6952..ca9e427d1 100644 --- a/packages/swipe/index.vue +++ b/packages/swipe/index.vue @@ -42,6 +42,7 @@ export default { data() { return { + width: 0, offset: 0, startX: 0, startY: 0, @@ -49,8 +50,7 @@ export default { deltaX: 0, swipes: [], direction: '', - currentDuration: 0, - width: window.innerWidth + currentDuration: 0 }; }, @@ -91,6 +91,7 @@ export default { initialize() { // reset offset when children changes clearTimeout(this.timer); + this.width = this.$el.getBoundingClientRect().width; this.active = 0; this.currentDuration = 0; this.offset = this.count > 1 ? -this.width : 0;