diff --git a/src/swipe/index.js b/src/swipe/index.js index ac5c9e121..5616e4df7 100644 --- a/src/swipe/index.js +++ b/src/swipe/index.js @@ -1,5 +1,6 @@ // Utils import { createNamespace } from '../utils'; +import { isHidden } from '../utils/dom/style'; import { preventDefault } from '../utils/dom/event'; import { doubleRaf } from '../utils/dom/raf'; import { range } from '../utils/format/number'; @@ -149,7 +150,7 @@ export default createComponent({ initialize(active = +this.initialSwipe) { clearTimeout(this.timer); - if (this.$el) { + if (this.$el && !isHidden(this.$el)) { const rect = this.$el.getBoundingClientRect(); this.computedWidth = +this.width || rect.width; this.computedHeight = +this.height || rect.height;