mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat(projects): 添加生产的主题配置缓存
This commit is contained in:
19
src/layouts/common/GlobalHeader/components/SettingButton.vue
Normal file
19
src/layouts/common/GlobalHeader/components/SettingButton.vue
Normal file
@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<hover-container
|
||||
class="w-40px h-full"
|
||||
tooltip-content="主题配置"
|
||||
:inverted="theme.header.inverted"
|
||||
@click="app.toggleSettingDrawerVisible"
|
||||
>
|
||||
<icon-ant-design-setting-outlined class="text-20px" />
|
||||
</hover-container>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useAppStore, useThemeStore } from '@/store';
|
||||
|
||||
const app = useAppStore();
|
||||
const theme = useThemeStore();
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
@ -6,5 +6,16 @@ import FullScreen from './FullScreen.vue';
|
||||
import ThemeMode from './ThemeMode.vue';
|
||||
import UserAvatar from './UserAvatar.vue';
|
||||
import SystemMessage from './SystemMessage.vue';
|
||||
import SettingButton from './SettingButton.vue';
|
||||
|
||||
export { MenuCollapse, GlobalBreadcrumb, HeaderMenu, GithubSite, FullScreen, ThemeMode, UserAvatar, SystemMessage };
|
||||
export {
|
||||
MenuCollapse,
|
||||
GlobalBreadcrumb,
|
||||
HeaderMenu,
|
||||
GithubSite,
|
||||
FullScreen,
|
||||
ThemeMode,
|
||||
UserAvatar,
|
||||
SystemMessage,
|
||||
SettingButton
|
||||
};
|
||||
|
@ -12,6 +12,7 @@
|
||||
<full-screen />
|
||||
<theme-mode />
|
||||
<system-message />
|
||||
<setting-button v-if="isProd" />
|
||||
<user-avatar />
|
||||
</div>
|
||||
</dark-mode-container>
|
||||
@ -29,7 +30,8 @@ import {
|
||||
FullScreen,
|
||||
ThemeMode,
|
||||
UserAvatar,
|
||||
SystemMessage
|
||||
SystemMessage,
|
||||
SettingButton
|
||||
} from './components';
|
||||
|
||||
interface Props {
|
||||
@ -44,6 +46,8 @@ interface Props {
|
||||
defineProps<Props>();
|
||||
|
||||
const theme = useThemeStore();
|
||||
|
||||
const isProd = import.meta.env.PROD;
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
@ -27,11 +27,9 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, nextTick, watch } from 'vue';
|
||||
import { useEventListener } from '@vueuse/core';
|
||||
import { ChromeTab, ButtonTab } from '@soybeanjs/vue-admin-tab';
|
||||
import { Icon } from '@iconify/vue';
|
||||
import { useThemeStore, useTabStore } from '@/store';
|
||||
import { setTabRoutes } from '@/utils';
|
||||
import { ContextMenu } from './components';
|
||||
|
||||
interface Emits {
|
||||
@ -95,11 +93,6 @@ watch(
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
|
||||
/** 页面离开时缓存多页签数据 */
|
||||
useEventListener(window, 'beforeunload', () => {
|
||||
setTabRoutes(tab.tabs);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
|
@ -9,7 +9,7 @@
|
||||
<theme-config />
|
||||
</n-drawer-content>
|
||||
</n-drawer>
|
||||
<drawer-button />
|
||||
<drawer-button v-if="isDev" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -17,6 +17,8 @@ import { useAppStore } from '@/store';
|
||||
import { DrawerButton, DarkMode, LayoutMode, ThemeColorSelect, PageFunc, PageView, ThemeConfig } from './components';
|
||||
|
||||
const app = useAppStore();
|
||||
|
||||
const isDev = import.meta.env.DEV;
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
|
Reference in New Issue
Block a user