Skip to content

Commit

Permalink
feat(projects): 添加页面缓存、记录在tab中的缓存页面的滚动条位置
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Jan 21, 2022
1 parent db3c25e commit 1d63a83
Show file tree
Hide file tree
Showing 26 changed files with 343 additions and 160 deletions.
9 changes: 5 additions & 4 deletions .env-config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/** 请求环境配置 */
type ServiceEnv = {
[key in Service.HttpEnv]: {
type ServiceEnv = Record<
Service.HttpEnv,
{
/** 请求环境 */
env: Service.HttpEnv;
/** 请求地址 */
url: string;
};
};
}
>;

/** 请求的环境 */
export const serviceEnv: ServiceEnv = {
Expand Down
36 changes: 25 additions & 11 deletions mock/api/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ const routes: AuthRoute.Route[] = [
path: '/dashboard/analysis',
component: 'self',
meta: {
title: '分析页'
title: '分析页',
requiresAuth: true,
keepAlive: true
}
},
{
Expand All @@ -20,13 +22,13 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: '工作台',
requiresAuth: true,
permissions: ['super', 'admin']
}
}
],
meta: {
title: '仪表盘',
requiresAuth: true,
icon: 'carbon:dashboard',
order: 1
}
Expand All @@ -41,38 +43,43 @@ const routes: AuthRoute.Route[] = [
path: '/document/vue',
component: 'self',
meta: {
title: 'vue文档'
title: 'vue文档',
requiresAuth: true
}
},
{
name: 'document_vue-new',
path: '/document/vue-new',
component: 'self',
meta: {
title: 'vue文档(新版)'
title: 'vue文档(新版)',
requiresAuth: true
}
},
{
name: 'document_vite',
path: '/document/vite',
component: 'self',
meta: {
title: 'vite文档'
title: 'vite文档',
requiresAuth: true
}
},
{
name: 'document_naive',
path: '/document/naive',
component: 'self',
meta: {
title: 'naive文档'
title: 'naive文档',
requiresAuth: true
}
},
{
name: 'document_project',
path: '/document/project',
meta: {
title: '项目文档(外链)',
requiresAuth: true,
href: 'https://docs.soybean.pro/'
}
}
Expand All @@ -89,7 +96,9 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: '关于',
requiresAuth: true,
singleLayout: 'basic',
keepAlive: true,
permissions: ['super', 'admin', 'test'],
icon: 'fluent:book-information-24-regular',
order: 7
Expand All @@ -105,23 +114,26 @@ const routes: AuthRoute.Route[] = [
path: '/exception/403',
component: 'self',
meta: {
title: '异常页403'
title: '异常页403',
requiresAuth: true
}
},
{
name: 'exception_404',
path: '/exception/404',
component: 'self',
meta: {
title: '异常页404'
title: '异常页404',
requiresAuth: true
}
},
{
name: 'exception_500',
path: '/exception/500',
component: 'self',
meta: {
title: '异常页500'
title: '异常页500',
requiresAuth: true
}
}
],
Expand All @@ -146,7 +158,8 @@ const routes: AuthRoute.Route[] = [
path: '/multi-menu/first/second',
component: 'self',
meta: {
title: '二级菜单'
title: '二级菜单',
requiresAuth: true
}
},
{
Expand All @@ -159,7 +172,8 @@ const routes: AuthRoute.Route[] = [
path: '/multi-menu/first/second-new/third',
component: 'self',
meta: {
title: '三级菜单'
title: '三级菜单',
requiresAuth: true
}
}
],
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dependencies": {
"@antv/g2plot": "^2.4.7",
"@better-scroll/core": "^2.4.2",
"@vueuse/core": "^7.5.3",
"@vueuse/core": "^7.5.4",
"axios": "^0.25.0",
"clipboard": "^2.0.8",
"colord": "^2.9.2",
Expand All @@ -41,9 +41,9 @@
"vue-router": "^4.0.12"
},
"devDependencies": {
"@commitlint/cli": "^16.0.3",
"@commitlint/cli": "^16.1.0",
"@commitlint/config-conventional": "^16.0.0",
"@iconify/json": "^1.1.458",
"@iconify/json": "^1.1.459",
"@iconify/vue": "^3.1.2",
"@types/crypto-js": "^4.1.0",
"@types/node": "^17.0.10",
Expand All @@ -64,16 +64,16 @@
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^8.3.0",
"husky": "^7.0.4",
"lint-staged": "^12.2.1",
"lint-staged": "^12.2.2",
"mockjs": "^1.1.0",
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0",
"prettier": "^2.5.1",
"rollup-plugin-visualizer": "^5.5.4",
"sass": "^1.49.0",
"typescript": "^4.5.4",
"typescript": "^4.5.5",
"unplugin-icons": "^0.13.0",
"unplugin-vue-components": "^0.17.13",
"unplugin-vue-components": "^0.17.14",
"vite": "^2.7.13",
"vite-plugin-html": "^2.1.2",
"vite-plugin-mock": "^2.9.6",
Expand Down
Loading

0 comments on commit 1d63a83

Please sign in to comment.