feat: 🎉新增 页面切换动画 功能

- 实现了在项目配置中可配置页面切换动画
- 编写 页面切换动画 功能单元测试
This commit is contained in:
XFeng
2026-01-13 19:50:40 +08:00
parent f41df4a811
commit 3bae086c32
9 changed files with 137 additions and 11 deletions

View File

@@ -49,6 +49,18 @@
<el-switch v-model="settingsStore.showWatermark" />
</div>
<div class="config-item flex-x-between">
<span class="text-xs">{{ t("settings.pageSwitchingAnimation") }}</span>
<el-select v-model="settingsStore.pageSwitchingAnimation" style="width: 150px">
<el-option
v-for="(item, key) in pageSwitchingAnimationOptions"
:key
:label="t(`settings.${item.value}`)"
:value="item.value"
/>
</el-select>
</div>
<div class="config-item flex-x-between">
<span class="text-xs">灰色模式</span>
<el-switch v-model="settingsStore.grayMode" />
@@ -159,10 +171,13 @@
import { DocumentCopy, RefreshLeft, Check } from "@element-plus/icons-vue";
const { t } = useI18n();
import { LayoutMode, SidebarColor, ThemeMode } from "@/enums";
import { LayoutMode, PageSwitchingAnimationOptions, SidebarColor, ThemeMode } from "@/enums";
import { useSettingsStore } from "@/store";
import { themeColorPresets, appConfig } from "@/settings";
// 页面切换动画选项
const pageSwitchingAnimationOptions: Record<string, OptionItem> = PageSwitchingAnimationOptions;
// 按钮图标
const copyIcon = markRaw(DocumentCopy);
const resetIcon = markRaw(RefreshLeft);