Skip to content

Commit

Permalink
fix: default setting not work
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Nov 19, 2024
1 parent ea8d43a commit 79d0684
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/static/Detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ import { useAuthModeFetch } from "~/composables/useAuthModeFetch"
import { useProviderMode } from "~/composables/useProviderMode"
import Sidebar from "~/components/static/Sidebar.vue"
import Outline from "~/components/static/Outline.vue"
import { Fold, Expand } from "@element-plus/icons-vue"
import AppConfig from "~/app.config"
import { Expand, Fold } from "@element-plus/icons-vue"
import { useStaticSettingStore } from "~/stores/useStaticSettingStore"

// https://github.com/nuxt/nuxt/issues/15346
Expand Down Expand Up @@ -121,7 +120,9 @@ const getPostData = async () => {
const getSetting = async () => {
const currentSetting = await getStaticSetting()
logger.info("currentSetting=>", currentSetting)
formData.setting = currentSetting
// 默认没有设置的时候应该显示
formData.setting.docTreeEnabled = currentSetting?.docTreeEnabled ?? true
formData.setting.outlineEnabled = currentSetting?.outlineEnabled ?? true
}
await getPostData()
await getSetting()
Expand Down

0 comments on commit 79d0684

Please sign in to comment.