diff --git a/src/App.vue b/src/App.vue index 999c41c..7883840 100644 --- a/src/App.vue +++ b/src/App.vue @@ -7,7 +7,9 @@ import { HomeOutlined, PicLeftOutlined, InfoCircleOutlined, - RedEnvelopeOutlined + RedEnvelopeOutlined, + AppstoreOutlined, + CloudOutlined, } from '@ant-design/icons-vue'; import {createFromIconfontCN} from '@ant-design/icons-vue'; import Urls from '@/assets/urls.json'; @@ -23,29 +25,39 @@ const items = ref([ key: 'home', icon: () => h(HomeOutlined), label: '主页', - title: '主页', - url: '/' + title: '主页' }, { key: 'view', icon: () => h(PicLeftOutlined), label: '概览', - title: '概览', - url: '/view' + title: '概览' }, { key: 'about', icon: () => h(InfoCircleOutlined), label: '关于', - title: '关于', - url: '/about' + title: '关于' }, { key: 'support', icon: () => h(RedEnvelopeOutlined), label: '支持我们', - title: '支持我们', - url: '/support' + title: '支持我们' + }, + { + key: 'additional', + icon: () => h(AppstoreOutlined), + label: '附加包', + title: '附加包', + children: [ + { + key: 'skyland', + icon: () => h(CloudOutlined), + label: '空岛附加', + title: '空岛附加' + } + ] } ]); @@ -59,7 +71,12 @@ function toggleCollapsed() { } function select(page: any) { - router.push(page.item.url); + let path: string = ''; + for (let p of page.keyPath) { + path += '/' + p + } + path = path === '/home' ? '/' : path; + router.push(path); } diff --git a/src/router/index.ts b/src/router/index.ts index 856fce3..1f7ad82 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,33 +1,45 @@ -import { createRouter, createWebHashHistory, Router } from 'vue-router'; +import {createRouter, createWebHashHistory, Router} from 'vue-router'; import MainPage from '../views/MainPage.vue'; import ImageViewPage from '../views/ImageViewPage.vue'; import AboutPage from '../views/AboutPage.vue'; import SupportPage from '../views/SupportPage.vue'; +import SkylandPage from '../views/additional/SkylandPage.vue'; const router: Router = createRouter({ - history: createWebHashHistory('/web'), - routes: [ - { - path: '/', - name: 'Main', - component: MainPage - }, - { - path: '/view', - name: 'Image', - component: ImageViewPage - }, - { - path: '/about', - name: 'About', - component: AboutPage - }, - { - path: '/support', - name: 'Support', - component: SupportPage - } - ] + history: createWebHashHistory('/web'), + routes: [ + { + path: '/', + name: 'Main', + component: MainPage + }, + { + path: '/view', + name: 'Image', + component: ImageViewPage + }, + { + path: '/about', + name: 'About', + component: AboutPage + }, + { + path: '/support', + name: 'Support', + component: SupportPage + }, + { + path: '/additional', + name: 'Additional', + children: [ + { + path: '/additional/skyland', + name: 'Additional', + component: SkylandPage + } + ] + } + ] }); export default router; diff --git a/src/views/SupportPage.vue b/src/views/SupportPage.vue index b75ece5..69554cd 100644 --- a/src/views/SupportPage.vue +++ b/src/views/SupportPage.vue @@ -21,7 +21,7 @@ const qrcodes = [
请备注称呼、游戏ID和B站UID - + diff --git a/src/views/additional/SkylandPage.vue b/src/views/additional/SkylandPage.vue new file mode 100644 index 0000000..96c0baf --- /dev/null +++ b/src/views/additional/SkylandPage.vue @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file