Project scenario:
Front-end project: vue3+Element-plus
Problem Description
Write a vue3 project and use the el-menu of element-plus as the side navigation bar. It turns out that the backgroud-color and color of el-menu-item can be modified, but the background-color and color of el-sub-menu cannot be modified. So I started searching on bing, and after reading various answers, I couldn't solve it. So I looked at the web page code and found the problem. . . .
Cause Analysis:
Tip: look at the class name
solution:
hint:
The codes given on the Internet are almost all el-submenu , but the real class of the component is el-sub-menu . If the class name is not written correctly, of course it will have no effect.