@@ -211,7 +217,7 @@ const clear = () => {
{{ t('setting.theme') }}
-
+
{{ t('setting.layout') }}
diff --git a/src/components/ThemeSwitch/src/ThemeSwitch.vue b/src/components/ThemeSwitch/src/ThemeSwitch.vue
index 71d8052..acf6c31 100644
--- a/src/components/ThemeSwitch/src/ThemeSwitch.vue
+++ b/src/components/ThemeSwitch/src/ThemeSwitch.vue
@@ -7,6 +7,8 @@ import { useDesign } from '@/hooks/web/useDesign'
const { getPrefixCls } = useDesign()
+const emit = defineEmits(['change'])
+
const prefixCls = getPrefixCls('theme-switch')
const Sun = useIcon({ icon: 'emojione-monotone:sun', color: '#fde047' })
@@ -23,6 +25,7 @@ const blackColor = 'var(--el-color-black)'
const themeChange = (val: boolean) => {
appStore.setIsDark(val)
+ emit('change', val)
}
diff --git a/src/layout/components/ToolHeader.vue b/src/layout/components/ToolHeader.vue
index 10d00e6..18bf00a 100644
--- a/src/layout/components/ToolHeader.vue
+++ b/src/layout/components/ToolHeader.vue
@@ -41,8 +41,7 @@ export default defineComponent({
id={`${variables.namespace}-tool-header`}
class={[
prefixCls,
- 'h-[var(--top-tool-height)] relative px-[var(--top-tool-p-x)] flex items-center justify-between',
- 'dark:bg-[var(--el-bg-color)]'
+ 'h-[var(--top-tool-height)] relative px-[var(--top-tool-p-x)] flex items-center justify-between'
]}
>
{layout.value !== 'top' ? (
diff --git a/src/utils/index.ts b/src/utils/index.ts
index 99acb77..8ac4d95 100644
--- a/src/utils/index.ts
+++ b/src/utils/index.ts
@@ -45,6 +45,10 @@ export const setCssVar = (prop: string, val: any, dom = document.documentElement
dom.style.setProperty(prop, val)
}
+export const getCssVar = (prop: string, dom = document.documentElement) => {
+ return getComputedStyle(dom).getPropertyValue(prop)
+}
+
/**
* 查找数组对象的某个下标
* @param {Array} ary 查找的数组