帮助中心页面,完成。
parent
e07f0f3bab
commit
bed91b658d
|
@ -419,4 +419,15 @@ module.exports = {
|
||||||
},
|
},
|
||||||
proxy: {},
|
proxy: {},
|
||||||
plugin: {},
|
plugin: {},
|
||||||
|
help: {
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
title: '查看DevSidecar的说明文档(Wiki)',
|
||||||
|
url: 'https://github.com/docmirror/dev-sidecar/wiki',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '为了展示更多帮助信息,请启用 “远程配置” 功能!!!',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
|
@ -1,8 +1,12 @@
|
||||||
<script>
|
<script>
|
||||||
import Plugin from '../mixins/plugin'
|
import Plugin from '../mixins/plugin'
|
||||||
|
import TreeNode from '../components/tree-node'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Help',
|
name: 'Help',
|
||||||
|
components: {
|
||||||
|
TreeNode,
|
||||||
|
},
|
||||||
mixins: [Plugin],
|
mixins: [Plugin],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
@ -10,19 +14,6 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
async openExternal (url) {
|
||||||
await this.$api.ipc.openExternal(url)
|
await this.$api.ipc.openExternal(url)
|
||||||
},
|
},
|
||||||
|
@ -35,12 +26,12 @@ export default {
|
||||||
<template slot="header">
|
<template slot="header">
|
||||||
帮助中心
|
帮助中心
|
||||||
<span>
|
<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>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div v-if="config">
|
<div v-if="config" class="help-list">
|
||||||
啊啊啊
|
<TreeNode :tree-data="config.help.dataList" />
|
||||||
</div>
|
</div>
|
||||||
</ds-container>
|
</ds-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -15,7 +15,7 @@ export default function createMenus (app) {
|
||||||
icon: 'api',
|
icon: 'api',
|
||||||
children: plugins,
|
children: plugins,
|
||||||
},
|
},
|
||||||
{ title: '帮助中心', path: '/help', icon: 'help' },
|
{ title: '帮助中心', path: '/help', icon: 'star' },
|
||||||
]
|
]
|
||||||
if (app.$global && app.$global.setting && app.$global.setting.overwall) {
|
if (app.$global && app.$global.setting && app.$global.setting.overwall) {
|
||||||
plugins.push({ title: '功能增强', path: '/plugin/overwall', icon: 'global' })
|
plugins.push({ title: '功能增强', path: '/plugin/overwall', icon: 'global' })
|
||||||
|
|
|
@ -138,3 +138,29 @@ hr {
|
||||||
margin: 0 5px 5px 5px;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue