Compare commits
No commits in common. "59992140323d292ee3d3f328e4fc69ea23258aef" and "00605c5eaebfe3c60f2e840c7093e0a186cd9315" have entirely different histories.
5999214032
...
00605c5eae
35
src/App.vue
35
src/App.vue
@ -1,43 +1,8 @@
|
|||||||
<script setup>
|
|
||||||
import {ref} from "vue";
|
|
||||||
|
|
||||||
const activeIndex = ref('1')
|
|
||||||
const handleSelect = (key, keyPath) => {
|
|
||||||
console.log(key, keyPath)
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-menu
|
|
||||||
:default-active="activeIndex"
|
|
||||||
class="el-menu-demo"
|
|
||||||
mode="horizontal"
|
|
||||||
@select="handleSelect"
|
|
||||||
>
|
|
||||||
<el-menu-item index="1">
|
|
||||||
<router-link to="/" class="no-underline">首页</router-link>
|
|
||||||
</el-menu-item>
|
|
||||||
</el-menu>
|
|
||||||
<div>
|
<div>
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.el-menu-demo {
|
|
||||||
width: 100%;
|
|
||||||
top: 0;
|
|
||||||
z-index: 1000;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center; /* 中心对齐 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.no-underline {
|
|
||||||
text-decoration: none;
|
|
||||||
color: inherit; /* 保持文字颜色与父元素一致 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-menu-item .no-underline:hover {
|
|
||||||
color: #409EFF; /* 鼠标悬停时的颜色,可以根据需要调整 */
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user