改进 抽屉菜单

This commit is contained in:
Twilight 2024-03-28 17:00:02 +08:00
parent 4225ae8629
commit 75a8efb735
3 changed files with 23 additions and 16 deletions

View File

@ -10,6 +10,7 @@
},
"dependencies": {
"@mdi/font": "6.2.95",
"@mdi/js": "^7.4.47",
"axios": "^1.6.8",
"core-js": "^3.34.0",
"keycloak-js": "^24.0.2",

View File

@ -11,22 +11,16 @@
<!-- <v-divider></v-divider> -->
<v-list density="compact" nav>
<template v-for="item in items">
<v-list-item
rounded="lg"
:prepend-icon="item.icon"
:title="item.text"
:value="item.text"
:to="item.to"
></v-list-item>
</template>
<!-- <v-list-item
prepend-icon="mdi-forum"
title="About"
value="about"
></v-list-item> -->
<v-list density="compact" nav>
<v-list-item
rounded="lg"
prepend-icon="mdi-home"
title="首页"
:to="route_names.home"
></v-list-item>
</v-list>
</v-navigation-drawer>
@ -43,7 +37,7 @@ import { ref } from "vue";
import app from "../../config/app";
import {useUserStore} from "@/stores/user";
const userStore = useUserStore()
import {mdiHome} from "@mdi/js/commonjs/mdi";
const drawer = ref(false);
@ -53,4 +47,11 @@ const items = ref([
// { icon: "mdi-history", text: "Frequently contacted", to: "/documents" },
{ icon: "mdi-account", text: userStore.access_token ? "注销" : "登录", to: { name: "login" } },
])
const route_names = ref({
"home": {
name: "home"
}
})
</script>

View File

@ -212,6 +212,11 @@
resolved "https://registry.npmjs.org/@mdi/font/-/font-6.2.95.tgz#7084ad939253a3d62e38f77d85f6c0c38508fbb2"
integrity sha512-0RKkhabkFZP3ALwKqrjhdKdhydQpoydIjX6cvjIwLyjADCsE0pG68YkGY+S3qnfdErmhS4m8adwvgrAFXp2AYQ==
"@mdi/js@^7.4.47":
version "7.4.47"
resolved "https://registry.npmjs.org/@mdi/js/-/js-7.4.47.tgz#7d8a4edc9631bffeed80d1ec784f9beae559a76a"
integrity sha512-KPnNOtm5i2pMabqZxpUz7iQf+mfrYZyKCZ8QNz85czgEt7cuHcGorWfdzUMWYA0SD+a6Hn4FmJ+YhzzzjkTZrQ==
"@nodelib/fs.scandir@2.1.5":
version "2.1.5"
resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"