Commit 930383f9ae17b18d697a35ef9c73ad17dbca1e13
1 parent
2ee01fa6
feat: add mainout page demo
Showing
8 changed files
with
45 additions
and
5 deletions
CHANGELOG.zh_CN.md
src/components/Upload/src/UploadModal.vue
... | ... | @@ -125,7 +125,7 @@ |
125 | 125 | |
126 | 126 | // 设置类型,则判断 |
127 | 127 | if (accept.length > 0 && !checkFileType(file, accept)) { |
128 | - createMessage.error!(t('acomponent.upload.cceptUpload', [accept.join(',')])); | |
128 | + createMessage.error!(t('component.upload.acceptUpload', [accept.join(',')])); | |
129 | 129 | return false; |
130 | 130 | } |
131 | 131 | const commonItem = { | ... | ... |
src/router/helper/menuHelper.ts
... | ... | @@ -23,7 +23,7 @@ function joinParentPath(list: any, node: any) { |
23 | 23 | parentPath += /^\//.test(p) ? p : `/${p}`; |
24 | 24 | }); |
25 | 25 | } |
26 | - node.path = `${parentPath}${/^\//.test(node.path) ? node.path : `/${node.path}`}`.replace( | |
26 | + node.path = `${/^\//.test(node.path) ? node.path : `${parentPath}/${node.path}`}`.replace( | |
27 | 27 | /\/\//g, |
28 | 28 | '/' |
29 | 29 | ); | ... | ... |
src/router/menus/modules/dashboard.ts
... | ... | @@ -8,11 +8,11 @@ const menu: MenuModule = { |
8 | 8 | path: '/dashboard', |
9 | 9 | children: [ |
10 | 10 | { |
11 | - path: '/workbench', | |
11 | + path: 'workbench', | |
12 | 12 | name: t('routes.dashboard.workbench'), |
13 | 13 | }, |
14 | 14 | { |
15 | - path: '/analysis', | |
15 | + path: 'analysis', | |
16 | 16 | name: t('routes.dashboard.analysis'), |
17 | 17 | }, |
18 | 18 | ], | ... | ... |
src/router/menus/modules/demo/feat.ts
src/router/routes/index.ts
... | ... | @@ -3,6 +3,7 @@ import type { AppRouteRecordRaw, AppRouteModule } from '/@/router/types'; |
3 | 3 | import { PAGE_NOT_FOUND_ROUTE, REDIRECT_ROUTE } from '../constant'; |
4 | 4 | |
5 | 5 | import modules from 'globby!/@/router/routes/modules/**/*.@(ts)'; |
6 | +import { mainOutRoutes } from './mainOut'; | |
6 | 7 | import { PageEnum } from '/@/enums/pageEnum'; |
7 | 8 | |
8 | 9 | import { t } from '/@/hooks/web/useI18n'; |
... | ... | @@ -35,4 +36,4 @@ export const LoginRoute: AppRouteRecordRaw = { |
35 | 36 | }; |
36 | 37 | |
37 | 38 | // 基础路由 不用权限 |
38 | -export const basicRoutes = [LoginRoute, RootRoute, REDIRECT_ROUTE]; | |
39 | +export const basicRoutes = [LoginRoute, RootRoute, ...mainOutRoutes, REDIRECT_ROUTE]; | ... | ... |
src/router/routes/mainOut.ts
0 → 100644
1 | +import type { AppRouteModule } from '/@/router/types'; | |
2 | + | |
3 | +// test | |
4 | +// http:ip:port/main-out | |
5 | +export const mainOutRoutes: AppRouteModule[] = [ | |
6 | + { | |
7 | + path: '/main-out', | |
8 | + name: 'MainOut', | |
9 | + component: () => import('/@/views/demo/main-out/index.vue'), | |
10 | + meta: { | |
11 | + title: 'MainOut', | |
12 | + ignoreAuth: true, | |
13 | + }, | |
14 | + }, | |
15 | +]; | |
16 | + | |
17 | +export const mainOutRouteNames = mainOutRoutes.map((item) => item.name); | ... | ... |
src/views/demo/main-out/index.vue
0 → 100644
1 | +<template> | |
2 | + <div class="test"> 位于主框架外的页面 </div> | |
3 | +</template> | |
4 | +<script lang="ts"> | |
5 | + import { defineComponent } from 'vue'; | |
6 | + | |
7 | + export default defineComponent({}); | |
8 | +</script> | |
9 | + | |
10 | +<style scoped> | |
11 | + .test { | |
12 | + position: fixed; | |
13 | + display: flex; | |
14 | + width: 100%; | |
15 | + height: 100%; | |
16 | + justify-content: center; | |
17 | + align-items: center; | |
18 | + font-size: 50px; | |
19 | + } | |
20 | +</style> | ... | ... |