mirror of
https://gitee.com/mirrors/AllinSSL.git
synced 2026-03-08 07:41:10 +08:00
【修复】api部分参数错误
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { defineComponent } from 'vue'
|
||||
import { defineComponent, watch } from 'vue'
|
||||
import {
|
||||
NConfigProvider,
|
||||
NDialogProvider,
|
||||
@@ -21,6 +21,14 @@ export default defineComponent({
|
||||
const { theme, themeOverrides } = useTheme() // 主题
|
||||
|
||||
console.log(theme.value, themeOverrides.value)
|
||||
|
||||
watch(
|
||||
() => themeOverrides.value,
|
||||
(newVal) => {
|
||||
console.log('1111', newVal)
|
||||
},
|
||||
)
|
||||
|
||||
// 国际化配置
|
||||
return () => (
|
||||
<NConfigProvider
|
||||
|
||||
@@ -52,13 +52,12 @@ export const useTheme = (name?: ThemeName) => {
|
||||
|
||||
// 主题继承修改
|
||||
const themeOverrides = computed(() => {
|
||||
return themeActiveOverrides.value || {}
|
||||
return themeActiveOverrides.value?.themeOverrides || {}
|
||||
})
|
||||
|
||||
// 预设配置
|
||||
const presetsOverrides = computed(() => {
|
||||
// 如果没有激活的主题,则返回空对象
|
||||
console.log('presetsOverrides', themeActiveOverrides.value)
|
||||
if (!themeActiveOverrides.value) return {}
|
||||
return themeActiveOverrides.value || {}
|
||||
})
|
||||
@@ -132,12 +131,16 @@ export const useTheme = (name?: ThemeName) => {
|
||||
// 加载主题样式
|
||||
const themeConfig = await themeItem.import()
|
||||
const themeStyles = await themeItem.styleContent() // 获取主题样式内容
|
||||
|
||||
// 加载新样式
|
||||
if (themeStyles || themeStyles) {
|
||||
loadDynamicCss(themeStyles as string, 'theme-style')
|
||||
}
|
||||
// 更新激活的主题
|
||||
themeActiveOverrides.value = themeConfig
|
||||
|
||||
console.log('themeActiveOverrides', themeActiveOverrides.value)
|
||||
console.log('themeOverrides', themeOverrides.value)
|
||||
} catch (error) {
|
||||
console.error(`加载主题失败 ${themeName}:`, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user