added ESlint 语法检测
This commit is contained in:
@@ -3,35 +3,34 @@ import Router from 'vue-router'
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
//获取原型对象上的push函数
|
||||
// 获取原型对象上的push函数
|
||||
const originalPush = Router.prototype.push
|
||||
//修改原型对象中的push方法
|
||||
// 修改原型对象中的push方法
|
||||
Router.prototype.push = function push(location) {
|
||||
return originalPush.call(this, location).catch(err => err)
|
||||
return originalPush.call(this, location).catch(err => err)
|
||||
}
|
||||
|
||||
const baseRouters = [{
|
||||
const baseRouters = [
|
||||
{
|
||||
path: '/',
|
||||
redirect: '/login'
|
||||
},
|
||||
{
|
||||
path: "/init",
|
||||
name: 'init',
|
||||
component: () =>
|
||||
import('@/view/init/init.vue')
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
path: '/init',
|
||||
name: 'Init',
|
||||
component: () => import('@/view/init/init')
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
name: 'login',
|
||||
component: () =>
|
||||
import('@/view/login/login.vue')
|
||||
}
|
||||
name: 'Login',
|
||||
component: () => import('@/view/login/login')
|
||||
}
|
||||
]
|
||||
|
||||
// 需要通过后台数据来生成的组件
|
||||
|
||||
const createRouter = () => new Router({
|
||||
routes: baseRouters
|
||||
routes: baseRouters
|
||||
})
|
||||
|
||||
const router = createRouter()
|
||||
|
Reference in New Issue
Block a user