You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
764 B
33 lines
764 B
// 引入必要的router组件 |
|
import {createRouter, createWebHistory} from 'vue-router' |
|
// 引入视图 |
|
// const root = () => import('../App.vue') |
|
const tableDemo1 = () => import('../views/Table_Demo1.vue') |
|
|
|
|
|
// 引入组件 |
|
|
|
|
|
// 创建路由 |
|
const routes = [ |
|
// { |
|
// path: "/", |
|
// name: 'root', |
|
// component: root |
|
// }, |
|
{ |
|
path: '/table1', |
|
name: 'table1', |
|
component: tableDemo1 |
|
}, |
|
] |
|
|
|
// 创建路由器,使用createRouter方法,传入history(路由类型)和 创建好的路由routes |
|
// 路由类型分为hash型和html5型,分别为createWebHashHistory和createWebHistory |
|
const router = createRouter({ |
|
history: createWebHistory(), |
|
routes |
|
}) |
|
|
|
// 导出路由 |
|
export default router
|
|
|