mirror of
https://gitee.com/was666/as-editor.git
synced 2026-08-11 00:00:27 +08:00
feat: v1.0.0
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import Vue from 'vue'
|
||||
import VueRouter from 'vue-router'
|
||||
|
||||
Vue.use(VueRouter)
|
||||
|
||||
const routes = [
|
||||
{ path: '/', redirect: '/establishShop' },
|
||||
{
|
||||
path: '/',
|
||||
name: 'layout',
|
||||
redirect: '/home',
|
||||
component: () => import('@/layout'),
|
||||
children: [
|
||||
{
|
||||
//首页
|
||||
path: '/home',
|
||||
name: 'home',
|
||||
component: () => import('@/layout/home'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
//创建页面
|
||||
path: '/establishShop',
|
||||
name: 'establishShop',
|
||||
component: () => import('@/views/establishShop'),
|
||||
},
|
||||
]
|
||||
|
||||
const router = new VueRouter({
|
||||
routes,
|
||||
})
|
||||
|
||||
export default router
|
||||
@@ -0,0 +1,14 @@
|
||||
import router from '@/router/index'
|
||||
/* 引入进度条 */
|
||||
import NProgress from 'nprogress'
|
||||
import 'nprogress/nprogress.css'
|
||||
NProgress.configure({ showSpinner: false })
|
||||
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
NProgress.start()
|
||||
next()
|
||||
})
|
||||
router.afterEach(() => {
|
||||
NProgress.done()
|
||||
window.scroll(0, 0)
|
||||
})
|
||||
Reference in New Issue
Block a user