fix vue-router NavigationDuplicated
优化 travis 流程 Former-commit-id: 6f9d375b53e7d91f39a39b18d917635a43e45508
This commit is contained in:
+10
-1
@@ -6,12 +6,21 @@ import NProgress from 'nprogress'
|
||||
import 'nprogress/nprogress.css'
|
||||
|
||||
import store from '@/store/index'
|
||||
|
||||
import util from '@/libs/util.js'
|
||||
|
||||
// 路由数据
|
||||
import routes from './routes'
|
||||
|
||||
// fix vue-router NavigationDuplicated
|
||||
const VueRouterPush = VueRouter.prototype.push
|
||||
VueRouter.prototype.push = function push (location) {
|
||||
return VueRouterPush.call(this, location).catch(err => err)
|
||||
}
|
||||
const VueRouterReplace = VueRouter.prototype.replace
|
||||
VueRouter.prototype.replace = function replace (location) {
|
||||
return VueRouterReplace.call(this, location).catch(err => err)
|
||||
}
|
||||
|
||||
Vue.use(VueRouter)
|
||||
|
||||
// 导出路由 在 main.js 里使用
|
||||
|
||||
Reference in New Issue
Block a user