hookehuyr

新增路由管理

This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
/*
* @Date: 2021-08-18 12:47:05
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-02-29 14:30:47
* @LastEditTime: 2024-06-21 16:19:04
* @FilePath: /vue-flow-editor/doc/main.ts
* @Description: 文件描述
*/
......@@ -13,6 +13,7 @@ import VueFlowEditor from '../src/index'
import element from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import router from './router'
import 'default-passive-events'
......@@ -24,7 +25,7 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
// 屏蔽警告信息
app.config.warnHandler = () => null;
app.use(VueFlowEditor).use(element)
app.use(VueFlowEditor).use(element).use(router)
// @ts-ignore
//Vue.use(window.ELEMENT)
//Vue.config.productionTip = false
......
/*
* @Date: 2022-07-18 10:22:22
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-06-21 16:28:50
* @FilePath: /vue-flow-editor/doc/route.js
* @Description: 文件描述
*/
export default [{
path: '/',
component: () => import('./index.vue'),
meta: {
title: '首页',
}
}];
/*
* @Date: 2022-05-26 13:57:28
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-06-29 21:36:59
* @FilePath: /tswj/src/router.js
* @Description: 文件描述
*/
import { createRouter, createWebHashHistory } from 'vue-router';
import RootRoute from './route.js';
// 创建路由实例并传递 `routes` 配置
const router = createRouter({
history: createWebHashHistory('/index.html'),
routes: [...RootRoute]
});
// router.beforeEach((to, from, next) => {
// next()
// })
// router.afterEach(() => {
// console.warn(to);
// console.warn(wx);
// share(to)
// })
export default router;