import { Component } from 'vue'; import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'; import { Document, Tools, UserFilled, Operation } from '@element-plus/icons-vue'; import Layout from '@/layout/index.vue'; declare module 'vue-router' { interface RouteMeta { hidden?: boolean; title?: string; icon?: Component; // requiresPermission?: string; } } export const routes: Array = [ // { path: '/product', component: () => import('@/views/product/index.vue'), meta: { hidden: true } }, { path: '/404', component: () => import('@/views/404.vue'), meta: { hidden: true } }, { path: '/403', component: () => import('@/views/403.vue'), meta: { hidden: true } }, { path: '', component: Layout, meta: { hidden: true }, children: [{ path: '', component: () => import('@/views/Home.vue'), meta: { title: 'menu.home' } }], }, { path: '/product', redirect: '/product/index', component: Layout, meta: { title: '产品经理' }, children: [ { path: 'index', component: () => import('@/views/product/List.vue'), meta: { title: '产品列表' } }, { path: 'cardList/:action', component: () => import('@/views/product/CardList.vue'), meta: { title: '配置风控' } }, ], }, { path: '/finance', // redirect: '/finance/index', component: Layout, meta: { title: '金融市场' }, children: [ { path: 'publish', component: () => import('@/views/finance/Publish.vue'), meta: { title: '发布' } }, { path: 'account', component: () => import('@/views/finance/Account.vue'), meta: { title: '我的账户' } }, ], }, // 404 page must be placed at the end !!! { path: '/:pathMatch(.*)*', name: 'not-found', redirect: '/404', meta: { hidden: true }, }, ]; const router = createRouter({ history: createWebHashHistory(), scrollBehavior: () => ({ top: 0 }), routes, }); export default router;