fix: 修复 container 组件 fluid 属性的类型推断警告

This commit is contained in:
就眠儀式 2022-04-07 21:10:12 +08:00
parent 6fe947ef79
commit f1832eaa1f
2 changed files with 5 additions and 6 deletions

View File

@ -9,7 +9,7 @@ import { computed } from "vue";
import "./index.less";
export interface LayContainerProps {
fluid?: boolean;
fluid?: boolean | string;
}
const props = withDefaults(defineProps<LayContainerProps>(), {

View File

@ -42,13 +42,12 @@ const changeLocales = (lang: string, locales: any, merge: boolean) => {
};
const changeTheme = (theme: string) => {
const defaultPartial: Partial<Theme> = {
mode: 1,
brightness: 100,
contrast: 90,
sepia: 0,
grayscale: 0
grayscale: 0,
};
const defaultFixes: DynamicThemeFix = {
@ -59,14 +58,14 @@ const changeTheme = (theme: string) => {
ignoreInlineStyle: [
".layui-colorpicker-trigger-span",
"div.layui-color-picker *",
]
],
};
Object.assign(defaultPartial, props.darkPartial);
if (theme === "dark") {
enableDarkMode(defaultPartial, defaultFixes);
} else if(theme === "light"){
} else if (theme === "light") {
disableDarkMode();
}
};