From 1306c6fd4e6fcbdabfe638abce694cf7ba34edbf Mon Sep 17 00:00:00 2001 From: BTMuli Date: Sun, 5 Mar 2023 17:38:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(sidebar):=20=E4=BE=A7=E8=BE=B9=E6=A0=8F?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20News=EF=BC=8C=E6=9A=82=E4=B8=94=E5=B0=B1?= =?UTF-8?q?=E8=BF=99=E4=BA=9B=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 24 ++++++++++++------------ src/App.vue | 4 ++-- src/components/t-sidebar.vue | 11 ++++++++--- src/pages/News.vue | 13 +++++++++++++ src/router/routes.ts | 10 ++++++++-- 5 files changed, 43 insertions(+), 19 deletions(-) create mode 100644 src/pages/News.vue diff --git a/components.d.ts b/components.d.ts index eff9cd4f..6f5095b7 100644 --- a/components.d.ts +++ b/components.d.ts @@ -5,17 +5,17 @@ // Read more: https://github.com/vuejs/core/pull/3399 import '@vue/runtime-core' -export {} +export {}; -declare module '@vue/runtime-core' { - export interface GlobalComponents { - ALayout: typeof import('ant-design-vue/es')['Layout'] - ALayoutContent: typeof import('ant-design-vue/es')['LayoutContent'] - ALayoutSider: typeof import('ant-design-vue/es')['LayoutSider'] - AMenu: typeof import('ant-design-vue/es')['Menu'] - AMenuItem: typeof import('ant-design-vue/es')['MenuItem'] - RouterLink: typeof import('vue-router')['RouterLink'] - RouterView: typeof import('vue-router')['RouterView'] - TSidebar: typeof import('./src/components/t-sidebar.vue')['default'] - } +declare module "@vue/runtime-core" { + export interface GlobalComponents { + ALayout: typeof import("ant-design-vue/es")["Layout"]; + ALayoutContent: typeof import("ant-design-vue/es")["LayoutContent"]; + ALayoutSider: typeof import("ant-design-vue/es")["LayoutSider"]; + AMenu: typeof import("ant-design-vue/es")["Menu"]; + AMenuItem: typeof import("ant-design-vue/es")["MenuItem"]; + RouterLink: typeof import("vue-router")["RouterLink"]; + RouterView: typeof import("vue-router")["RouterView"]; + TSidebar: typeof import("./src/components/t-sidebar.vue")["default"]; + } } diff --git a/src/App.vue b/src/App.vue index 2915a7ec..59236792 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,7 +3,7 @@ - + @@ -22,4 +22,4 @@ export default defineComponent({ }); - + diff --git a/src/components/t-sidebar.vue b/src/components/t-sidebar.vue index 64448282..050689fe 100644 --- a/src/components/t-sidebar.vue +++ b/src/components/t-sidebar.vue @@ -8,11 +8,15 @@ > - Home + 首页 + + + + 咨讯 - Config + 设置 @@ -20,13 +24,14 @@ + + diff --git a/src/router/routes.ts b/src/router/routes.ts index 7e8398c9..0bafdc5a 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -1,19 +1,25 @@ import Home from "../pages/Home.vue"; +import News from "../pages/News.vue"; import Config from "../pages/Config.vue"; const routes = [ { path: "/", - name: "Home", + name: "首页", component: Home, }, { path: "/home", redirect: "/", }, + { + path: "/news", + name: "咨讯", + component: News, + }, { path: "/config", - name: "Config", + name: "设置", component: Config, }, ];