123456789101112131415161718192021 |
- import { createRouter, createWebHashHistory } from 'vue-router'
- import { routes } from './config'
- import { computed } from 'vue'
- import { routesMetas } from './constant'
- import type { RoutesName } from './constant'
- export const history = createWebHashHistory()
- export const router = createRouter({ history, routes })
- export const currentMeta = computed(() => {
- const currentName = router.currentRoute.value.name as RoutesName
- if (currentName && currentName in routesMetas) {
- return routesMetas[currentName]
- }
- })
- export * from './config'
- export * from './constant'
- export default router
|