mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-12-28 11:06:00 +08:00
feat(ui): 管理后台基础配置
This commit is contained in:
29
gpt-vue/projects/vue-admin/src/components/SystemMenu.vue
Normal file
29
gpt-vue/projects/vue-admin/src/components/SystemMenu.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import router from "@/router";
|
||||
import showMenu from "@/router/menu";
|
||||
|
||||
defineProps({
|
||||
width: {
|
||||
type: [Number, String],
|
||||
default: 200,
|
||||
},
|
||||
});
|
||||
const route = useRoute();
|
||||
const goto = (name: string) => router.push({ name });
|
||||
const selectedKeys = computed(() => [route.name]);
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<ALayoutSider :style="{ width, height: '100%' }">
|
||||
<AMenu :selected-keys="selectedKeys" @menu-item-click="goto">
|
||||
<AMenuItem v-for="item in showMenu" :key="item.name">
|
||||
<template #icon>
|
||||
<component :is="item.meta?.icon" />
|
||||
</template>
|
||||
{{ item.meta.title }}
|
||||
</AMenuItem>
|
||||
</AMenu>
|
||||
</ALayoutSider>
|
||||
</template>
|
||||
Reference in New Issue
Block a user