css-Ant-Menu 导航菜单更改为左侧列表行选中

1.Ant-Menu导航菜单

导航菜单是一个网站的灵魂,用户依赖导航在各个页面中进行跳转。一般分为顶部导航和侧边导航,顶部导航提供全局性的类目和功能,侧边导航提供多级结构来收纳和排列网站架构。

2.具体代码

html

html 复制代码
 <!-- 左侧切换 -->
                <div class="fileLeft">
                    <div class="content_left_name">类型</div>
                    <a-menu style="width: 100%" mode="vertical">
                        <a-menu-item v-for="(item, index) in componentList" :key="index">
                            <div class="content_left_select"  @click="handleClick(item.id)">
                                <IconComponent :statues="item.statues" style="width:35px"></IconComponent>
                                <div class="content_left_title">{{item.name}}</div>
                            </div>
                        </a-menu-item>
                    </a-menu>
                </div>

css

css 复制代码
// 左侧结构
.fileLeft {
    width: 20%;
    height: 100%;
    float: left;
    background-color: #ffffff;
    border-radius: 8px;
}
// 左侧name
.content_left_name{
	height:40px;
	width: 100%;
	padding-left: 2%;
	line-height:40px;
	text-align:left;
	background-color: #fafafa;
	font-weight: 600;
	font-size: 15px;
	border-bottom: 1px solid #e8e8e8;
}
// icon与文本
.content_left_select{
	display:flex;
	flex-direction:row;
}
//文本
.content_left_title{
	height:40px;
	width:60px
}
相关推荐
Larcher26 分钟前
新手也能学会,100行代码玩AI LOGO
前端·llm·html
徐子颐38 分钟前
从 Vibe Coding 到 Agent Coding:Cursor 2.0 开启下一代 AI 开发范式
前端
小月鸭1 小时前
如何理解HTML语义化
前端·html
jump6801 小时前
url输入到网页展示会发生什么?
前端
诸葛韩信1 小时前
我们需要了解的Web Workers
前端
brzhang1 小时前
我觉得可以试试 TOON —— 一个为 LLM 而生的极致压缩数据格式
前端·后端·架构
yivifu2 小时前
JavaScript Selection API详解
java·前端·javascript
这儿有一堆花2 小时前
告别 Class 组件:拥抱 React Hooks 带来的函数式新范式
前端·javascript·react.js
十二春秋2 小时前
场景模拟:基础路由配置
前端
六月的可乐2 小时前
实战干货-Vue实现AI聊天助手全流程解析
前端·vue.js·ai编程