File was renamed from src/layout/Header.vue |
| | |
| | | mode="horizontal" |
| | | :default-active="activeIndex" |
| | | class="header-menu" |
| | | @select="handleSelect" |
| | | router |
| | | > |
| | | <el-menu-item index="/">模型管理</el-menu-item> |
| | | <el-menu-item index="/simulation-config">可视化仿真</el-menu-item> |
| | | <el-menu-item index="/system/user">系统管理</el-menu-item> |
| | | <!-- <el-menu-item index="/">模型管理</el-menu-item> |
| | | <el-menu-item index="/simulation">可视化仿真</el-menu-item> |
| | | <el-menu-item index="/systemManage">系统管理</el-menu-item> --> |
| | | <el-menu-item |
| | | v-for="(item,index) in navList" |
| | | :key="item.path" |
| | | :index="item.path" |
| | | @click="handleSelect(item.path, index)" |
| | | >{{ item.name }}</el-menu-item |
| | | > |
| | | </el-menu> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ref, defineEmits } from "vue"; |
| | | import { useRoute, useRouter } from "vue-router"; |
| | | const router = useRouter(); |
| | | const route = useRoute(); |
| | | |
| | | const activeIndex = ref("/"); |
| | | const emit = defineEmits(["selectMenu"]); |
| | | const navList = ref([ |
| | | { |
| | | name: "模型管理", |
| | | path: "/model", |
| | | }, |
| | | { |
| | | name: "可视化仿真", |
| | | path: "/simulation", |
| | | }, |
| | | { |
| | | name: "系统管理", |
| | | path: "/systemManage", |
| | | }, |
| | | ]); |
| | | |
| | | const handleSelect = (key: string) => { |
| | | activeIndex.value = key; |
| | | emit("selectMenu", key); |
| | | const handleSelect = (path: string) => { |
| | | activeIndex.value = path; |
| | | router.push(path); |
| | | }; |
| | | </script> |
| | | |