Skip to content

Commit 1035f2a

Browse files
author
spark
committed
feat(frontend): 添加关于软件页面
- 在 App.vue 中添加关于软件的菜单项 - 在 router.js 中添加关于软件的路由- 新增 about.vue 组件,包含软件介绍和作者信息
1 parent cb28b18 commit 1035f2a

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

frontend/src/App.vue

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,23 @@ const menuOptions = ref([
102102
key: 'exit',
103103
icon: renderIcon(PowerOutline),
104104
},
105+
{
106+
label: () =>
107+
h(
108+
RouterLink,
109+
{
110+
to: {
111+
name: 'about',
112+
params: {
113+
id: 'zh-CN'
114+
}
115+
}
116+
},
117+
{ default: () => '关于软件' }
118+
),
119+
key: 'about',
120+
icon: renderIcon(StarOutline),
121+
},
105122
])
106123
function renderIcon(icon) {
107124
return () => h(NIcon, null, { default: () => h(icon) })

frontend/src/components/about.vue

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<script setup>
2+
3+
</script>
4+
5+
<template>
6+
7+
<n-flex justify="center" style="margin-top: 12px;padding-left: 12px;height: 100%">
8+
<n-card size="large">
9+
<h1>go-stock</h1>
10+
<n-image size="large" src="https://raw.githubusercontent.com/ArvinLovegood/go-stock/master/build/appicon.png" />
11+
<p>自选股行情实时监控,基于Wails和NaiveUI构建的AI赋能股票分析工具</p>
12+
<p>
13+
欢迎点赞GitHub:<a href="https://github.com/ArvinLovegood/go-stock" target="_blank">go-stock</a>
14+
</p>
15+
</n-card>
16+
<n-card size="large">
17+
<h1>关于作者</h1>
18+
<n-image size="large" src="https://avatars.githubusercontent.com/u/7401917?v=4" />
19+
<h1><a href="https://github.com/ArvinLovegood" target="_blank">@ArvinLovegood</a></h1>
20+
<p>一个热爱编程的小白,欢迎关注我的Github</p>
21+
</n-card>
22+
</n-flex>
23+
24+
</template>
25+
26+
<style scoped>
27+
28+
</style>

frontend/src/router/router.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import { createMemoryHistory, createRouter } from 'vue-router'
22

33
import stockView from '../components/stock.vue'
44
import settingsView from '../components/settings.vue'
5+
import about from "../components/about.vue";
56

67
const routes = [
78
{ path: '/', component: stockView,name: 'stock' },
89
{ path: '/settings/:id', component: settingsView,name: 'settings' },
10+
{ path: '/about', component: about,name: 'about' },
911
]
1012

1113
const router = createRouter({

0 commit comments

Comments
 (0)