elementUI modify the secondary menu to modify the el-submenu__title style does not take effect (solved)

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
insert image description here


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.

Guess you like

Origin blog.csdn.net/m0_50115641/article/details/128819420