帮助中心页面,完成。

pull/408/head
王良 2024-12-01 03:47:26 +08:00
parent e07f0f3bab
commit bed91b658d
5 changed files with 70 additions and 17 deletions

View File

@ -419,4 +419,15 @@ module.exports = {
},
proxy: {},
plugin: {},
help: {
data: [
{
title: '查看DevSidecar的说明文档Wiki',
url: 'https://github.com/docmirror/dev-sidecar/wiki',
},
{
title: '为了展示更多帮助信息,请启用 “远程配置” 功能!!!',
},
],
},
}

View File

@ -0,0 +1,25 @@
<script>
export default {
name: 'TreeNode',
props: {
treeData: Array,
},
methods: {
async openExternal (url) {
await this.$api.ipc.openExternal(url)
},
},
}
</script>
<template>
<ul>
<li v-for="node in treeData" :key="node.title">
<span v-if="node.url && (node.url.startsWith('http://') || node.url.startsWith('https://'))" :title="node.title">
<a @click="openExternal(node.url)">{{ node.title }}</a>
</span>
<span v-else :title="node.title">{{ node.title }}</span>
<tree-node v-if="node.children && node.children.length > 0" :tree-data="node.children" class="child-node" />
</li>
</ul>
</template>

View File

@ -1,8 +1,12 @@
<script>
import Plugin from '../mixins/plugin'
import TreeNode from '../components/tree-node'
export default {
name: 'Help',
components: {
TreeNode,
},
mixins: [Plugin],
data () {
return {
@ -10,19 +14,6 @@ export default {
}
},
methods: {
ready (config) {
},
async openLog () {
const dir = await this.$api.info.getConfigDir()
this.$api.ipc.openPath(`${dir}/logs/`)
},
async applyBefore () {
if (!this.config.app.showHideShortcut) {
this.config.app.showHideShortcut = '无'
}
},
async applyAfter () {
},
async openExternal (url) {
await this.$api.ipc.openExternal(url)
},
@ -35,12 +26,12 @@ export default {
<template slot="header">
帮助中心
<span>
<a-button type="primary" @click="openExternal('https://github.com/docmirror/dev-sidecar/issues/new/choose')"></a-button>
<a-button @click="openExternal('https://github.com/docmirror/dev-sidecar/issues/new/choose')"></a-button>
</span>
</template>
<div v-if="config">
啊啊啊
<div v-if="config" class="help-list">
<TreeNode :tree-data="config.help.dataList" />
</div>
</ds-container>
</template>

View File

@ -15,7 +15,7 @@ export default function createMenus (app) {
icon: 'api',
children: plugins,
},
{ title: '帮助中心', path: '/help', icon: 'help' },
{ title: '帮助中心', path: '/help', icon: 'star' },
]
if (app.$global && app.$global.setting && app.$global.setting.overwall) {
plugins.push({ title: '功能增强', path: '/plugin/overwall', icon: 'global' })

View File

@ -138,3 +138,29 @@ hr {
margin: 0 5px 5px 5px;
}
}
.help-list {
ul {
padding-left: 10px;
li {
list-style: none;
line-height: 35px;
span {
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
a:hover {
text-decoration: underline;
}
}
//
ul {
padding-left: 20px;
}
}
}