From 893a19205603f24ae5bef06406a06ed84e8376d8 Mon Sep 17 00:00:00 2001 From: Yao Date: Sat, 19 Aug 2017 12:27:05 +0800 Subject: [PATCH] fix: swipe sometimes will change to drag image (#81) * swipe forbid dragstart --- docs/examples-docs/swipe.md | 27 +++++++++++++++++++++++++++ package.json | 2 ++ packages/swipe/src/input.js | 1 + 3 files changed, 30 insertions(+) diff --git a/docs/examples-docs/swipe.md b/docs/examples-docs/swipe.md index c76ecc9b8..6343fc1b8 100644 --- a/docs/examples-docs/swipe.md +++ b/docs/examples-docs/swipe.md @@ -64,6 +64,33 @@ export default { ``` ::: +#### 隐藏指示器 + +需要设置`show-indicators`属性为`false`,即会隐藏指示器。 + +:::demo 隐藏指示器 +```html + + + + + + + +``` +::: + #### 自动轮播 需要设置`auto-play`属性为`true`,即会自动轮播。 diff --git a/package.json b/package.json index 5157ab4b4..8545ea148 100644 --- a/package.json +++ b/package.json @@ -73,6 +73,8 @@ "friendly-errors-webpack-plugin": "^1.6.1", "gh-pages": "^1.0.0", "gulp": "^3.9.1", + "gulp-cssmin": "^0.2.0", + "gulp-postcss": "^7.0.0", "gulp-util": "^3.0.8", "highlight.js": "^9.12.0", "html-webpack-plugin": "^2.29.0", diff --git a/packages/swipe/src/input.js b/packages/swipe/src/input.js index 5e2fe9658..9721af6a4 100755 --- a/packages/swipe/src/input.js +++ b/packages/swipe/src/input.js @@ -26,6 +26,7 @@ Input.prototype = Object.create(new EventEmitter()); extend(Input.prototype, { bind: function(host) { if (Vue.prototype.$isServer) return; + bindEvents(host, 'dragstart', e => e.preventDefault()); bindEvents(host, 'touchstart mousedown', this.onTouchStart); if (this.options.listenMoving) { bindEvents(window, 'touchmove mousemove', this.onTouchMove);