fix: 修复 container 组件 fluid 属性的类型推断警告
This commit is contained in:
parent
6fe947ef79
commit
f1832eaa1f
@ -9,7 +9,7 @@ import { computed } from "vue";
|
|||||||
import "./index.less";
|
import "./index.less";
|
||||||
|
|
||||||
export interface LayContainerProps {
|
export interface LayContainerProps {
|
||||||
fluid?: boolean;
|
fluid?: boolean | string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<LayContainerProps>(), {
|
const props = withDefaults(defineProps<LayContainerProps>(), {
|
||||||
|
@ -42,13 +42,12 @@ const changeLocales = (lang: string, locales: any, merge: boolean) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const changeTheme = (theme: string) => {
|
const changeTheme = (theme: string) => {
|
||||||
|
|
||||||
const defaultPartial: Partial<Theme> = {
|
const defaultPartial: Partial<Theme> = {
|
||||||
mode: 1,
|
mode: 1,
|
||||||
brightness: 100,
|
brightness: 100,
|
||||||
contrast: 90,
|
contrast: 90,
|
||||||
sepia: 0,
|
sepia: 0,
|
||||||
grayscale: 0
|
grayscale: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
const defaultFixes: DynamicThemeFix = {
|
const defaultFixes: DynamicThemeFix = {
|
||||||
@ -59,14 +58,14 @@ const changeTheme = (theme: string) => {
|
|||||||
ignoreInlineStyle: [
|
ignoreInlineStyle: [
|
||||||
".layui-colorpicker-trigger-span",
|
".layui-colorpicker-trigger-span",
|
||||||
"div.layui-color-picker *",
|
"div.layui-color-picker *",
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.assign(defaultPartial, props.darkPartial);
|
Object.assign(defaultPartial, props.darkPartial);
|
||||||
|
|
||||||
if (theme === "dark") {
|
if (theme === "dark") {
|
||||||
enableDarkMode(defaultPartial, defaultFixes);
|
enableDarkMode(defaultPartial, defaultFixes);
|
||||||
} else if(theme === "light"){
|
} else if (theme === "light") {
|
||||||
disableDarkMode();
|
disableDarkMode();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user