element-plus el-menu折叠右侧箭头不消失
时间: 2023-07-22 14:24:46 浏览: 286
您好,要想让element-plus的el-menu折叠右侧箭头不消失,您可以在el-menu组件中添加`collapse-transition`属性,并在样式中设置`.el-menu__icon-arrow`的`opacity`为1,如下所示:
```
<template>
<el-menu :default-active="activeIndex" class="menu" mode="vertical" :collapse-transition="false">
<el-submenu index="1">
<template #title>
<i class="el-icon-location"></i>
<span>导航一</span>
</template>
<el-menu-item index="1-1">选项1</el-menu-item>
<el-menu-item index="1-2">选项2</el-menu-item>
<el-menu-item index="1-3">选项3</el-menu-item>
</el-submenu>
<el-submenu index="2">
<template #title>
<i class="el-icon-menu"></i>
<span>导航二</span>
</template>
<el-menu-item index="2-1">选项1</el-menu-item>
<el-menu-item index="2-2">选项2</el-menu-item>
<el-menu-item index="2-3">选项3</el-menu-item>
</el-submenu>
</el-menu>
</template>
<style>
.el-menu__icon-arrow {
opacity: 1 !important;
}
</style>
```
这样就可以让el-menu折叠右侧箭头不消失了。希望能够帮到您。
阅读全文