feat(projects): 新增导航模式配置
This commit is contained in:
parent
f2ad76df42
commit
49c2dc4f23
28
src/components/common/ColorBlock/index.vue
Normal file
28
src/components/common/ColorBlock/index.vue
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<template>
|
||||||
|
<div class="flex-center w-20px h-20px mx-6px mb-8px cursor-pointer rounded-2px" :style="{ backgroundColor: color }">
|
||||||
|
<icon-ic-outline-check
|
||||||
|
v-if="checked"
|
||||||
|
class="text-14px text-white"
|
||||||
|
:class="[isWhite ? 'text-gray-700' : 'text-white']"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed } from 'vue';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
color: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
checked: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const whiteColors = ['#ffffff', '#fff', 'rgb(255,255,255)'];
|
||||||
|
const isWhite = computed(() => whiteColors.includes(props.color));
|
||||||
|
</script>
|
||||||
|
<style scoped></style>
|
@ -1,3 +1,4 @@
|
|||||||
import AppProviderContent from './AppProviderContent/index.vue';
|
import AppProviderContent from './AppProviderContent/index.vue';
|
||||||
|
import ColorBlock from './ColorBlock/index.vue';
|
||||||
|
|
||||||
export { AppProviderContent };
|
export { AppProviderContent, ColorBlock };
|
||||||
|
@ -1 +1 @@
|
|||||||
export { AppProviderContent } from './common';
|
export { AppProviderContent, ColorBlock } from './common';
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
export enum EnumNavMode {
|
export enum EnumNavMode {
|
||||||
'vertical' = '左侧菜单模式',
|
'vertical' = '左侧菜单模式',
|
||||||
'horizontal' = '顶部菜单模式',
|
'horizontal' = '顶部菜单模式',
|
||||||
|
'vertical-mix' = '左侧菜单混合模式',
|
||||||
'horizontal-mix' = '顶部菜单混合模式'
|
'horizontal-mix' = '顶部菜单混合模式'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
<template>
|
||||||
|
<n-divider title-placement="center">导航栏模式</n-divider>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { NDivider } from 'naive-ui';
|
||||||
|
</script>
|
||||||
|
<style scoped></style>
|
@ -1,21 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<n-divider title-placement="center">系统主题</n-divider>
|
<n-divider title-placement="center">系统主题</n-divider>
|
||||||
<div class="flex flex-wrap justify-between">
|
<div class="flex flex-wrap justify-between">
|
||||||
<div
|
<color-block
|
||||||
v-for="color in app.themeSettings.themeColorList"
|
v-for="color in app.themeSettings.themeColorList"
|
||||||
:key="color"
|
:key="color"
|
||||||
class="flex-center w-20px h-20px mx-6px mb-8px cursor-pointer rounded-2px"
|
:color="color"
|
||||||
:style="{ backgroundColor: color }"
|
:checked="color === app.themeSettings.themeColor"
|
||||||
@click="setThemeColor(color)"
|
@click="setThemeColor(color)"
|
||||||
>
|
/>
|
||||||
<icon-ic-outline-check v-if="color === app.themeSettings.themeColor" class="text-14px text-white" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { NDivider } from 'naive-ui';
|
import { NDivider } from 'naive-ui';
|
||||||
import { useAppStore } from '@/store';
|
import { useAppStore } from '@/store';
|
||||||
|
import { ColorBlock } from '@/components';
|
||||||
|
|
||||||
const app = useAppStore();
|
const app = useAppStore();
|
||||||
const { setThemeColor } = useAppStore();
|
const { setThemeColor } = useAppStore();
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import DarkMode from './DarkMode.vue';
|
import DarkMode from './DarkMode.vue';
|
||||||
|
import NavMode from './NavMode.vue';
|
||||||
import SystemTheme from './SystemTheme.vue';
|
import SystemTheme from './SystemTheme.vue';
|
||||||
|
|
||||||
export { DarkMode, SystemTheme };
|
export { DarkMode, NavMode, SystemTheme };
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<n-drawer v-model:show="app.settingDrawer.visible">
|
<n-drawer v-model:show="app.settingDrawer.visible">
|
||||||
<n-drawer-content title="主题配置">
|
<n-drawer-content title="主题配置" :native-scrollbar="false">
|
||||||
<dark-mode />
|
<dark-mode />
|
||||||
|
<nav-mode />
|
||||||
<system-theme />
|
<system-theme />
|
||||||
</n-drawer-content>
|
</n-drawer-content>
|
||||||
</n-drawer>
|
</n-drawer>
|
||||||
@ -10,7 +11,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { NDrawer, NDrawerContent } from 'naive-ui';
|
import { NDrawer, NDrawerContent } from 'naive-ui';
|
||||||
import { useAppStore } from '@/store';
|
import { useAppStore } from '@/store';
|
||||||
import { DarkMode, SystemTheme } from './components';
|
import { DarkMode, NavMode, SystemTheme } from './components';
|
||||||
|
|
||||||
const app = useAppStore();
|
const app = useAppStore();
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user