src/layout/components/header.vue
@@ -21,6 +21,12 @@ >{{ item.name }}</el-menu-item > </el-menu> <div class="header-right"> <div class="user-info" @click="handleUserClick"> <el-avatar src="path/to/avatar.png"></el-avatar> <span>用户名</span> </div> </div> </div> </template> @@ -50,6 +56,10 @@ activeIndex.value = path; router.push(path); }; const handleUserClick = () => { router.push("/user/profile"); }; </script> <style lang="less" scoped>