解决首页白屏,添加fastclick

This commit is contained in:
406803045 2019-06-26 14:54:58 +08:00
parent 3579fed1c9
commit af358fb91d
3 changed files with 15 additions and 3 deletions

View File

@ -16,6 +16,7 @@
},
"dependencies": {
"axios": "0.18.0",
"fastclick": "^1.0.6",
"lib-flexible": "^0.3.2",
"normalize.css": "7.0.0",
"vant": "^1.6.19",

View File

@ -8,8 +8,18 @@ import store from './store'
import router from './router'
import '@/filters' // filters
import '@/permission' // permission 权限
// 解决移动端click事件300毫秒延迟方法
import FastClick from 'fastclick'
if ('addEventListener' in document) {
document.addEventListener(
'DOMContentLoaded',
function() {
FastClick.attach(document.body)
},
false
)
}
Vue.config.productionTip = false
new Vue({
el: '#app',
router,

View File

@ -1,5 +1,6 @@
import router from './router'
router.beforeEach(async(to, from, next) => {})
router.beforeEach(async(to, from, next) => {
next()
})
router.afterEach(() => {})