2023-04-20 12:01:38 +00:00
|
|
|
<!-- App -->
|
2023-06-14 14:51:50 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
import { onBeforeMount } from 'vue'
|
|
|
|
// 导入设置面板 store
|
|
|
|
import { useKUNGalgameSettingsStore } from '@/store/modules/settings'
|
|
|
|
import { storeToRefs } from 'pinia'
|
|
|
|
|
|
|
|
// 使用设置面板的 store
|
|
|
|
const settingsStore = useKUNGalgameSettingsStore()
|
|
|
|
const { showKUNGalgameMode } = storeToRefs(settingsStore)
|
|
|
|
|
|
|
|
// 必须在这里调用生命周期函数,初始化主题
|
|
|
|
onBeforeMount(() => {
|
|
|
|
const theme = showKUNGalgameMode.value
|
|
|
|
|
|
|
|
// 恢复保存的主题状态
|
|
|
|
if (theme) {
|
|
|
|
document.documentElement.className = theme
|
|
|
|
}
|
|
|
|
})
|
|
|
|
</script>
|
2023-04-14 13:58:13 +00:00
|
|
|
|
|
|
|
<template>
|
2023-05-02 09:44:23 +00:00
|
|
|
<RouterView />
|
2023-04-14 13:58:13 +00:00
|
|
|
</template>
|
|
|
|
|
2023-04-18 08:04:47 +00:00
|
|
|
<style scoped></style>
|