From 1035f2a800c243a04101cb015eabbfbd41d07e1b Mon Sep 17 00:00:00 2001 From: spark Date: Sat, 8 Feb 2025 12:20:40 +0800 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20=E6=B7=BB=E5=8A=A0=E5=85=B3?= =?UTF-8?q?=E4=BA=8E=E8=BD=AF=E4=BB=B6=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 App.vue 中添加关于软件的菜单项 - 在 router.js 中添加关于软件的路由- 新增 about.vue 组件,包含软件介绍和作者信息 --- frontend/src/App.vue | 17 +++++++++++++++++ frontend/src/components/about.vue | 28 ++++++++++++++++++++++++++++ frontend/src/router/router.js | 2 ++ 3 files changed, 47 insertions(+) create mode 100644 frontend/src/components/about.vue diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 4e4651b..4fefc5c 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -102,6 +102,23 @@ const menuOptions = ref([ key: 'exit', icon: renderIcon(PowerOutline), }, + { + label: () => + h( + RouterLink, + { + to: { + name: 'about', + params: { + id: 'zh-CN' + } + } + }, + { default: () => '关于软件' } + ), + key: 'about', + icon: renderIcon(StarOutline), + }, ]) function renderIcon(icon) { return () => h(NIcon, null, { default: () => h(icon) }) diff --git a/frontend/src/components/about.vue b/frontend/src/components/about.vue new file mode 100644 index 0000000..8f12e76 --- /dev/null +++ b/frontend/src/components/about.vue @@ -0,0 +1,28 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/router/router.js b/frontend/src/router/router.js index 19930a8..7ad0c0f 100644 --- a/frontend/src/router/router.js +++ b/frontend/src/router/router.js @@ -2,10 +2,12 @@ import { createMemoryHistory, createRouter } from 'vue-router' import stockView from '../components/stock.vue' import settingsView from '../components/settings.vue' +import about from "../components/about.vue"; const routes = [ { path: '/', component: stockView,name: 'stock' }, { path: '/settings/:id', component: settingsView,name: 'settings' }, + { path: '/about', component: about,name: 'about' }, ] const router = createRouter({