elmenu修改,正确跳转到站外链接

This commit is contained in:
2025-03-05 08:45:31 +08:00
parent 166a6d8171
commit d57b407df8

View File

@ -1,17 +1,15 @@
<template> <template>
<el-menu <el-menu mode="horizontal" router>
mode="horizontal"
router
>
<el-menu-item index="/">首页</el-menu-item> <el-menu-item index="/">首页</el-menu-item>
<el-menu-item > <el-menu-item @click="goToBlog">博客</el-menu-item>
<a href="blog.kisechan.space" target="_blank">博客</a>
</el-menu-item>
<el-menu-item index="/about">关于</el-menu-item> <el-menu-item index="/about">关于</el-menu-item>
</el-menu> </el-menu>
</template> </template>
<script setup> <script setup>
const goToBlog = () => {
window.open("https://blog.kisechan.space", "_blank");
};
</script> </script>
<style scoped> <style scoped>
@ -19,4 +17,4 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
</style> </style>