vue3版本初版上线 自测已可用

This commit is contained in:
piexlmax
2021-08-26 12:45:41 +08:00
parent adc7f567f9
commit 265e42f513
81 changed files with 4478 additions and 18639 deletions

View File

@@ -1,38 +1,24 @@
import Vue from 'vue'
import Router from 'vue-router'
import { createRouter, createWebHashHistory } from 'vue-router'
Vue.use(Router)
// 获取原型对象上的push函数
const originalPush = Router.prototype.push
// 修改原型对象中的push方法
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
const routes = [{
path: '/',
redirect: '/login'
},
{
path: '/init',
name: 'Init',
component: () => import('@/view/init/index')
},
{
path: '/login',
name: 'Login',
component: () => import('@/view/login/index')
}
const baseRouters = [
{
path: '/',
redirect: '/login'
},
{
path: '/init',
name: 'Init',
component: () => import('@/view/init/index')
},
{
path: '/login',
name: 'Login',
component: () => import('@/view/login/index')
}
]
// 需要通过后台数据来生成的组件
const createRouter = () => new Router({
routes: baseRouters
const router = createRouter({
history: createWebHashHistory(),
routes
})
const router = createRouter()
export default router