1.通过触摸元素可知
这个箭头icon其实是通过::before和::after伪元素组合写出来的
2.模仿使用伪元素书写
同理,我们也使用伪元素写icon即可
::v-deep .ant-menu{
// 折叠
.ant-menu-submenu-inline > .ant-menu-submenu-title .ant-menu-submenu-arrow::after{
width: 10px;
height: 1.5px;
background-color: #8a8a8a!important;
background-image:none;
transform: rotate(0deg) translateX(0px);
}
.ant-menu-submenu-inline > .ant-menu-submenu-title .ant-menu-submenu-arrow::before{
width: 10px;
height: 1.5px;
background-color: #8a8a8a!important;
background-image:none;
transform: rotate(90deg) translateY(0px);
}
// 展开
.ant-menu-submenu-open.ant-menu-submenu-inline > .ant-menu-submenu-title .ant-menu-submenu-arrow::after{
width: 10px;
height: 1.5px;
background-color: #8a8a8a!important;
background-image:none;
transform: rotate(0deg) translateY(0px);
}
.ant-menu-submenu-open.ant-menu-submenu-inline > .ant-menu-submenu-title .ant-menu-submenu-arrow::before{
display: none;
}
}