From 12d8b4079a89f41a1eea111be64d42802dd70a78 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 28 Dec 2017 11:17:09 +0800 Subject: [PATCH] Add fastclick --- package.json | 30 ++++++++++++++++++++++++------ src/index.js | 2 ++ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 1c072e77..723f5165 100755 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "core-js": "^2.5.1", "dva": "^2.1.0", "enquire-js": "^0.1.1", + "fastclick": "^1.0.6", "g-cloud": "^1.0.2-beta", "g2": "^2.3.13", "g2-plugin-slider": "^1.2.1", @@ -84,14 +85,27 @@ "nightmare": "^2.10.0" }, "babel": { - "presets": ["env", "react"], - "plugins": ["transform-decorators-legacy", "transform-class-properties"] + "presets": [ + "env", + "react" + ], + "plugins": [ + "transform-decorators-legacy", + "transform-class-properties" + ] }, "jest": { - "setupFiles": ["/tests/setupTests.js"], - "testMatch": ["**/?(*.)(spec|test|e2e).js?(x)"], + "setupFiles": [ + "/tests/setupTests.js" + ], + "testMatch": [ + "**/?(*.)(spec|test|e2e).js?(x)" + ], "setupTestFrameworkScriptFile": "/tests/jasmine.js", - "moduleFileExtensions": ["js", "jsx"], + "moduleFileExtensions": [ + "js", + "jsx" + ], "moduleNameMapper": { "\\.(css|less)$": "/tests/styleMock.js" } @@ -100,5 +114,9 @@ "**/*.{js,jsx}": "lint-staged:js", "**/*.less": "stylelint --syntax less" }, - "browserslist": ["> 1%", "last 2 versions", "not ie <= 10"] + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 10" + ] } diff --git a/src/index.js b/src/index.js index 1298630b..ea22cc02 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,7 @@ import 'babel-polyfill'; import dva from 'dva'; import 'moment/locale/zh-cn'; +import FastClick from 'fastclick'; import './g2'; import './rollbar'; import onError from './error'; @@ -23,3 +24,4 @@ app.router(require('./router')); // 5. Start app.start('#root'); +FastClick.attach(document.body); -- GitLab