Skip to content

Commit 24aab5b

Browse files
committed
feat: And surface switching loading optimization
1 parent 6afed34 commit 24aab5b

File tree

24 files changed

+595
-1695
lines changed

24 files changed

+595
-1695
lines changed

apps/web-antd/src/router/guard.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,21 @@ function setupCommonGuard(router: Router) {
2222
const loadedPaths = new Set<string>();
2323

2424
router.beforeEach(async (to) => {
25+
to.meta.loaded = loadedPaths.has(to.path);
26+
2527
// 页面加载进度条
26-
if (preferences.transition.progress) {
28+
if (!to.meta.loaded && preferences.transition.progress) {
2729
startProgress();
2830
}
29-
to.meta.loaded = loadedPaths.has(to.path);
3031
return true;
3132
});
3233

3334
router.afterEach((to) => {
3435
// 记录页面是否加载,如果已经加载,后续的页面切换动画等效果不在重复执行
35-
loadedPaths.add(to.path);
36+
37+
if (preferences.tabbar.enable) {
38+
loadedPaths.add(to.path);
39+
}
3640

3741
// 关闭页面加载进度条
3842
if (preferences.transition.progress) {

apps/web-antd/src/views/dashboard/index.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
// import { echartsInstance as echarts } from '@vben/chart-ui';
55
6-
defineOptions({ name: 'WelCome' });
6+
defineOptions({ name: 'Welcome' });
77
88
// const cardList = ref([
99
// {
@@ -247,5 +247,4 @@ defineOptions({ name: 'WelCome' });
247247

248248
<template>
249249
<div>dashboard</div>
250-
<!-- <Dashboard :card-list="cardList" :chart-tabs="chartTabs" /> -->
251250
</template>

cspell.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"language": "en,en-US",
44
"allowCompoundWords": true,
55
"words": [
6+
"clsx",
67
"esno",
8+
"taze",
79
"acmr",
810
"antd",
911
"brotli",

internal/lint-configs/eslint-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"eslint-config-prettier": "^9.1.0",
3939
"eslint-plugin-eslint-comments": "^3.2.0",
4040
"eslint-plugin-i": "^2.29.1",
41-
"eslint-plugin-jsdoc": "^48.4.0",
41+
"eslint-plugin-jsdoc": "^48.5.0",
4242
"eslint-plugin-jsonc": "^2.16.0",
4343
"eslint-plugin-n": "^17.9.0",
4444
"eslint-plugin-no-only-tests": "^3.1.0",

internal/tailwind-config/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ export default {
105105
DEFAULT: 'hsl(var(--card))',
106106
foreground: 'hsl(var(--card-foreground))',
107107
},
108-
109108
destructive: {
110109
...createColorsPattern('destructive'),
111110
DEFAULT: 'hsl(var(--destructive))',
112111
},
112+
113113
foreground: 'hsl(var(--foreground))',
114114
green: {
115115
...createColorsPattern('green'),
@@ -146,7 +146,6 @@ export default {
146146
desc: 'hsl(var(--secondary-desc))',
147147
foreground: 'hsl(var(--secondary-foreground))',
148148
},
149-
150149
success: {
151150
...createColorsPattern('success'),
152151
DEFAULT: 'hsl(var(--success))',

internal/vite-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"rollup": "^4.18.0",
4747
"rollup-plugin-visualizer": "^5.12.0",
4848
"sass": "^1.77.6",
49-
"unplugin-turbo-console": "^1.8.7",
49+
"unplugin-turbo-console": "^1.8.8-beta.1",
5050
"vite": "^5.3.1",
5151
"vite-plugin-compression": "^0.5.1",
5252
"vite-plugin-dts": "^3.9.1",

internal/vite-config/src/plugins/inject-app-loading/loading.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
.title {
3636
margin-top: 66px;
37-
font-size: 30px;
37+
font-size: 28px;
3838
font-weight: 600;
3939
color: rgb(0 0 0 / 85%);
4040
}
@@ -56,7 +56,7 @@
5656
width: 48px;
5757
height: 5px;
5858
content: '';
59-
background: #0065cc50;
59+
background: hsl(var(--primary) / 50%);
6060
border-radius: 50%;
6161
animation: shadow-ani 0.5s linear infinite;
6262
}
@@ -68,7 +68,7 @@
6868
width: 100%;
6969
height: 100%;
7070
content: '';
71-
background: #0065cc;
71+
background: hsl(var(--primary));
7272
border-radius: 4px;
7373
animation: jump-ani 0.5s linear infinite;
7474
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"is-ci": "^3.0.1",
6969
"jsdom": "^24.1.0",
7070
"rimraf": "^5.0.7",
71-
"taze": "^0.13.8",
71+
"taze": "^0.13.9",
7272
"turbo": "^2.0.5",
7373
"typescript": "^5.5.2",
7474
"unbuild": "^2.0.0",

packages/@core/forward/preferences/src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const defaultPreferences: Preferences = {
7676
},
7777
transition: {
7878
enable: true,
79+
loading: true,
7980
name: 'fade-slide',
8081
progress: true,
8182
},

packages/@core/forward/preferences/src/preferences.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,9 @@ class PreferenceManager {
341341
// 保存重置后的偏好设置
342342
this.savePreferences(this.state);
343343
// 从存储中移除偏好设置项
344-
this.cache?.removeItem(STORAGE_KEY);
345-
this.cache?.removeItem(STORAGE_KEY_THEME);
346-
this.cache?.removeItem(STORAGE_KEY_LOCALE);
344+
[STORAGE_KEY, STORAGE_KEY_THEME, STORAGE_KEY_LOCALE].forEach((key) => {
345+
this.cache?.removeItem(key);
346+
});
347347
}
348348

349349
/**

0 commit comments

Comments
 (0)