2024-08-26 14:07:57 +08:00
|
|
|
<template>
|
|
|
|
<n-config-provider
|
|
|
|
:date-locale="configProviderProps.dateLocale"
|
|
|
|
:inline-theme-disabled="configProviderProps.inlineThemeDisabled"
|
|
|
|
:locale="configProviderProps.locale"
|
2024-08-27 20:59:54 +08:00
|
|
|
:style="{
|
|
|
|
'--color-error': themeVars.errorColor,
|
|
|
|
'--color-info': themeVars.infoColor,
|
|
|
|
'--color-primary': themeVars.primaryColor,
|
|
|
|
'--color-success': themeVars.successColor,
|
|
|
|
'--color-warning': themeVars.warningColor,
|
|
|
|
}"
|
2024-08-26 14:07:57 +08:00
|
|
|
>
|
|
|
|
|
|
|
|
<!-- Naive UI 全局样式 -->
|
|
|
|
<n-global-style></n-global-style>
|
|
|
|
|
|
|
|
<!-- 全局侧边栏 -->
|
2024-08-27 20:59:54 +08:00
|
|
|
<div class="app-aside-wrapper">
|
|
|
|
<app-aside />
|
|
|
|
</div>
|
2024-08-26 14:07:57 +08:00
|
|
|
|
|
|
|
<!-- 路由页面 -->
|
|
|
|
<router-view class="app-view"></router-view>
|
|
|
|
|
|
|
|
</n-config-provider>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import {
|
2024-08-27 20:59:54 +08:00
|
|
|
NConfigProvider, NGlobalStyle, useThemeVars,
|
2024-08-26 14:07:57 +08:00
|
|
|
} from 'naive-ui';
|
|
|
|
|
|
|
|
import {
|
|
|
|
configProviderProps,
|
|
|
|
} from './assets/js/naive-ui';
|
2024-08-27 20:59:54 +08:00
|
|
|
|
|
|
|
import AppAside from './components/AppAside.vue';
|
|
|
|
|
|
|
|
/** 主题变量 */
|
|
|
|
const themeVars = useThemeVars();
|
2024-08-26 14:07:57 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less">
|
|
|
|
// 全局 CSS 变量
|
|
|
|
:root {
|
|
|
|
// 基础颜色
|
|
|
|
--color-black: #252525;
|
|
|
|
--color-gray: #E0E0E0;
|
|
|
|
// 分类颜色
|
|
|
|
--color-bg-dark: #252525;
|
|
|
|
--color-bg-light: #F8F8F8;
|
|
|
|
// 滚动条大小
|
|
|
|
--scrollbar-size: 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 滚动条
|
|
|
|
::-webkit-scrollbar {
|
|
|
|
width: var(--scrollbar-size);
|
|
|
|
height: var(--scrollbar-size);
|
|
|
|
}
|
|
|
|
::-webkit-scrollbar-corner {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
::-webkit-scrollbar-track {
|
|
|
|
background-color: transparent;
|
|
|
|
}
|
|
|
|
::-webkit-scrollbar-thumb {
|
|
|
|
border-radius: 16px;
|
|
|
|
background-color: #CFCFCF;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background-color: #C0C0C0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
html, body, #app, .n-config-provider {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
html, body {
|
|
|
|
user-select: none;
|
|
|
|
-webkit-tap-highlight-color: transparent;
|
|
|
|
}
|
|
|
|
html {
|
|
|
|
background-color: #FFF;
|
|
|
|
color: var(--color-black);
|
|
|
|
font-size: 16px;
|
2024-08-27 20:59:54 +08:00
|
|
|
line-height: 1;
|
2024-08-26 14:07:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.n-config-provider {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row
|
|
|
|
}
|
|
|
|
|
|
|
|
.app-aside, .app-view {
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
|
2024-08-27 20:59:54 +08:00
|
|
|
.app-aside-wrapper {
|
|
|
|
width: 64px;
|
|
|
|
border-right: 1px solid var(--color-gray);
|
2024-08-26 14:07:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.app-view {
|
|
|
|
flex-grow: 1;
|
|
|
|
width: 0;
|
|
|
|
}
|
|
|
|
</style>
|