08335 / hivui-platform-template
hivui平台项目模板
Newer
Older
hivui-platform-template / project / hivuiMain / router.js
caibinghong on 4 Jun 2021 add
import Vue from 'vue'
import Router from 'vue-router'
import Layout from './views/layout/index.vue'
//import Home from './views/Home.vue'
import Design from './views/design/index.vue'
import store from './store/index'

Vue.use(Router)

const router =new Router({
  //mode: 'history',
  mode: 'hash',
  base: import.meta.env.VITE_BASE_URL,
  routes: [
    {
      path: '/',
      name: 'home',
      meta: {},
      component: Layout
    },{
      path: '/design',
      name: 'design',
      meta: { title: '门户自定义'},
      component: Design
    },{
      path: '/test',
      name: 'testApi',
      meta: {},
      component: () => import( './views/test/index.vue')
    },
    /*
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      // webpackChunkName: "about" 
      component: () => import( './views/About.vue')
    },
    */ 
    {
      path: '*',
      name: 'home',
      meta: {},
      component: Layout
    },
  ]
}) 
export default router;