refactor(projects): 代码优化

This commit is contained in:
Soybean
2022-05-11 00:18:36 +08:00
parent 50d7ccd82d
commit a1c7e10574
5 changed files with 24 additions and 28 deletions

View File

@ -4,19 +4,17 @@
class="h-full bg-[#f6f9f8] dark:bg-[#101014] transition duration-300 ease-in-out"
>
<router-view v-slot="{ Component, route }">
<div class="h-full">
<transition
:name="theme.pageAnimateMode"
mode="out-in"
:appear="true"
@before-leave="handleBeforeLeave"
@after-enter="handleAfterEnter"
>
<keep-alive :include="routeStore.cacheRoutes">
<component :is="Component" v-if="app.reloadFlag" :key="route.path" />
</keep-alive>
</transition>
</div>
<transition
:name="theme.pageAnimateMode"
mode="out-in"
:appear="true"
@before-leave="handleBeforeLeave"
@after-enter="handleAfterEnter"
>
<keep-alive :include="routeStore.cacheRoutes">
<component :is="Component" v-if="app.reloadFlag" :key="route.path" />
</keep-alive>
</transition>
</router-view>
</div>
</template>

View File

@ -1,17 +1,15 @@
<template>
<n-divider title-placement="center">主题</n-divider>
<n-divider title-placement="center">主题模式</n-divider>
<n-space vertical size="large">
<setting-menu label="深色主题">
<div class="flex-center">
<n-switch :value="theme.darkMode" @update:value="theme.setDarkMode">
<template #checked>
<icon-mdi-white-balance-sunny class="text-14px text-primary" />
</template>
<template #unchecked>
<icon-mdi-moon-waning-crescent class="text-14px text-primary" />
</template>
</n-switch>
</div>
<n-switch :value="theme.darkMode" @update:value="theme.setDarkMode">
<template #checked>
<icon-mdi-white-balance-sunny class="text-14px text-primary" />
</template>
<template #unchecked>
<icon-mdi-moon-waning-crescent class="text-14px text-primary" />
</template>
</n-switch>
</setting-menu>
<setting-menu label="跟随系统">
<n-switch :value="theme.followSystemTheme" @update:value="theme.setFollowSystemTheme">