mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 15:13:30 +00:00
feat(front): add Navbar component and update layout with background image
This commit is contained in:
30
front/components/Navbar.vue
Normal file
30
front/components/Navbar.vue
Normal file
@@ -0,0 +1,30 @@
|
||||
<template>
|
||||
<div class="flex flex-row bg-white/10 backdrop-blur-xl p-2 rounded-full">
|
||||
<div v-for="item in routes" :key="item.key"
|
||||
:class="cx('flex flex-row text-sm px-4 py-2 font-bold rounded-full cursor-pointer',
|
||||
item?.key === type && 'bg-black/10'
|
||||
)"
|
||||
@click="()=>{
|
||||
router.push({
|
||||
query: {
|
||||
...route.query,
|
||||
type: item.key
|
||||
}
|
||||
})
|
||||
}"
|
||||
>
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { cx } from 'class-variance-authority'
|
||||
const routes = [
|
||||
{ name: '文件', key: 'file' },
|
||||
{ name: '文本', key: 'text' }
|
||||
]
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const type = computed(() => route?.query?.type)
|
||||
</script>
|
||||
@@ -1,5 +1,9 @@
|
||||
<template>
|
||||
<div>
|
||||
<slot />
|
||||
<div class="h-screen w-screen">
|
||||
<img class="w-full h-full object-cover absolute inset-0 -z-[1]" src="https://fuwari.vercel.app/_astro/demo-banner.DFyx781H_Z1gN7UP.webp" />
|
||||
<div class=" h-full w-full flex flex-col items-center p-10">
|
||||
<Navbar />
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -10,6 +10,7 @@
|
||||
"postinstall": "nuxt prepare"
|
||||
},
|
||||
"dependencies": {
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"nuxt": "^3.16.0",
|
||||
"vue": "latest",
|
||||
"vue-router": "latest"
|
||||
|
||||
Reference in New Issue
Block a user