af358fb9 by 406803045

解决首页白屏,添加fastclick

1 parent 3579fed1
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
16 }, 16 },
17 "dependencies": { 17 "dependencies": {
18 "axios": "0.18.0", 18 "axios": "0.18.0",
19 "fastclick": "^1.0.6",
19 "lib-flexible": "^0.3.2", 20 "lib-flexible": "^0.3.2",
20 "normalize.css": "7.0.0", 21 "normalize.css": "7.0.0",
21 "vant": "^1.6.19", 22 "vant": "^1.6.19",
......
...@@ -8,8 +8,18 @@ import store from './store' ...@@ -8,8 +8,18 @@ import store from './store'
8 import router from './router' 8 import router from './router'
9 import '@/filters' // filters 9 import '@/filters' // filters
10 import '@/permission' // permission 权限 10 import '@/permission' // permission 权限
11 // 解决移动端click事件300毫秒延迟方法
12 import FastClick from 'fastclick'
13 if ('addEventListener' in document) {
14 document.addEventListener(
15 'DOMContentLoaded',
16 function() {
17 FastClick.attach(document.body)
18 },
19 false
20 )
21 }
11 Vue.config.productionTip = false 22 Vue.config.productionTip = false
12
13 new Vue({ 23 new Vue({
14 el: '#app', 24 el: '#app',
15 router, 25 router,
......
1 import router from './router' 1 import router from './router'
2 2
3 router.beforeEach(async(to, from, next) => {}) 3 router.beforeEach(async(to, from, next) => {
4 4 next()
5 })
5 router.afterEach(() => {}) 6 router.afterEach(() => {})
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!