新增功能:添加帮助文档入口,首次启动启动器时自动打开帮助文档

This commit is contained in:
li-xiaochen 2024-12-26 08:41:33 +08:00
parent 92ef815d0d
commit f22594a260
7 changed files with 22 additions and 4 deletions

View file

@ -12,6 +12,10 @@ const loading = ref(true)
const page = ref(null)
let conf
function show_doc() {
window.open('https://hedgedoc.zhaozuohong.vip/s/LfSzK2n0K', '_blank')
}
async function init_version() {
version.value = await pywebview.api.get_version()
new_version.value = await pywebview.api.get_new_version()
@ -22,7 +26,11 @@ async function init_version() {
async function initialize_config() {
await configStore.load_config()
conf = configStore.config
await init_version()
init_version()
if (!conf.is_already_show_doc) {
show_doc()
conf.is_already_show_doc = true
}
loading.value = false
}
@ -95,6 +103,9 @@ provide('new_version', new_version)
</template>
<settings />
</n-tab-pane>
<template #suffix>
<n-button type="primary" secondary size="small" @click="show_doc">帮助文档</n-button>
</template>
</n-tabs>
</n-notification-provider>
<n-global-style />

View file

@ -6,6 +6,7 @@ export const useConfigStore = defineStore('config', () => {
this.page = conf.page
this.branch = conf.branch
this.mirror = conf.mirror
this.is_already_show_doc = conf.is_already_show_doc
}
}