mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
fix(projects): 修复vertical sider自适应主题
This commit is contained in:
@ -33,8 +33,29 @@ import {
|
||||
} from 'naive-ui';
|
||||
import { AppProviderContent } from '@/components';
|
||||
import { useThemeStore } from '@/store';
|
||||
import { addColorAlpha } from '@/utils';
|
||||
|
||||
const theme = useThemeStore();
|
||||
const dark = computed(() => (theme.darkMode ? darkTheme : undefined));
|
||||
|
||||
const primary = computed(() => theme.themeColor);
|
||||
const primaryWithAlpha = computed(() => {
|
||||
const alpha = theme.darkMode ? 0.15 : 0.1;
|
||||
return addColorAlpha(primary.value, alpha);
|
||||
});
|
||||
</script>
|
||||
<style scoped></style>
|
||||
<style>
|
||||
/* 全局与主题颜色相关 */
|
||||
.g_text-primary {
|
||||
color: v-bind(primary);
|
||||
}
|
||||
.g_bg-primary {
|
||||
background-color: v-bind(primary);
|
||||
}
|
||||
.g_bg-primary_active {
|
||||
background-color: v-bind(primaryWithAlpha);
|
||||
}
|
||||
.g_border-primary {
|
||||
border-color: v-bind(primary);
|
||||
}
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user