Update Nav

This commit is contained in:
Thehrz 2023-02-10 21:05:35 +08:00
parent 5ee3d9fa4b
commit 3d26633fd2
7 changed files with 30 additions and 37 deletions

1
.github/FUNDING.yml vendored
View File

@ -1 +0,0 @@
github: antfu

2
src/components.d.ts vendored
View File

@ -9,6 +9,8 @@ declare module '@vue/runtime-core' {
export interface GlobalComponents { export interface GlobalComponents {
ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
Footer: typeof import('./components/Footer.vue')['default']
Nav: typeof import('./components/Nav.vue')['default']
README: typeof import('./components/README.md')['default'] README: typeof import('./components/README.md')['default']
RouterLink: typeof import('vue-router')['RouterLink'] RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView'] RouterView: typeof import('vue-router')['RouterView']

View File

@ -9,7 +9,7 @@ const toggleLocales = () => {
</script> </script>
<template> <template>
<nav text-xl mt-6> <nav class="text-xl m-6 flex justify-center">
<RouterLink class="icon-btn mx-2" to="/" :title="t('button.home')"> <RouterLink class="icon-btn mx-2" to="/" :title="t('button.home')">
<div i-carbon-campsite /> <div i-carbon-campsite />
</RouterLink> </RouterLink>

23
src/components/Nav.vue Normal file
View File

@ -0,0 +1,23 @@
<template>
<nav>
<el-menu mode="horizontal" :ellipsis="false" :default-active="$route.path" class="p-l p-r" router>
<!-- <nuxt-link to="/"> -->
<el-menu-item>
合肥市南园学校19预科2班
</el-menu-item>
<div class="grow" />
<el-menu-item index="/">
主页
</el-menu-item>
<!-- </nuxt-link> -->
<!-- <div class="flex-grow" /> -->
<!-- <nuxt-link v-for="page in pages" :to="page.path">
<el-menu-item :index="page.path">
{{ page.name }}
</el-menu-item>
</nuxt-link> -->
</el-menu>
</nav>
</template>

View File

@ -1,10 +0,0 @@
## Components
Components in this dir will be auto-registered and on-demand, powered by [`unplugin-vue-components`](https://github.com/antfu/unplugin-vue-components).
### Icons
You can use icons from almost any icon sets by the power of [Iconify](https://iconify.design/).
It will only bundle the icons you use. Check out [`unplugin-icons`](https://github.com/antfu/unplugin-icons) for more details.

View File

@ -22,31 +22,9 @@ export default {
</script> </script>
<template> <template>
<nav> <main class="text-gray-700 dark:text-gray-200 min-h-screen flex flex-col">
<el-menu <Nav />
mode="horizontal"
:ellipsis="false"
:default-active="$route.path"
router
>
<!-- <nuxt-link to="/"> -->
<el-menu-item index="/">
主页
</el-menu-item>
<!-- </nuxt-link> -->
<!-- <div class="flex-grow" /> -->
<!-- <nuxt-link v-for="page in pages" :to="page.path">
<el-menu-item :index="page.path">
{{ page.name }}
</el-menu-item>
</nuxt-link> -->
</el-menu>
</nav>
<main class="px-4 py-10 text-center text-gray-700 dark:text-gray-200 min-h-screen flex flex-col items-center ">
<RouterView /> <RouterView />
<TheFooter /> <Footer />
</main> </main>
</template> </template>

View File

@ -8,6 +8,7 @@ import generatedRoutes from '~pages'
import '@unocss/reset/tailwind.css' import '@unocss/reset/tailwind.css'
import './styles/main.css' import './styles/main.css'
import 'uno.css' import 'uno.css'
import 'element-plus/theme-chalk/dark/css-vars.css'
const routes = setupLayouts(generatedRoutes) const routes = setupLayouts(generatedRoutes)