kun-galgame-vue/src/App.vue

37 lines
864 B
Vue
Raw Normal View History

2023-04-20 12:01:38 +00:00
<!-- App -->
2023-06-14 14:51:50 +00:00
<script setup lang="ts">
2023-06-15 14:11:55 +00:00
// 导入通知和提示组件
2023-06-16 02:15:47 +00:00
import Alert from '@/components/alert/Alert.vue'
import Info from '@/components/alert/Info.vue'
2023-06-15 14:11:55 +00:00
2023-06-14 14:51:50 +00:00
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-06-15 14:11:55 +00:00
<!-- 全局警告组件 -->
<Alert />
<!-- 全局通知组件 -->
<Info />
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>