react ant-menu-item-selected选中的菜单样式修改

之前引入的方式是

import styles from './index.less';

然后我在index.less里修改,没有一点反应,后来发现上面引入的方式只是把样式导进去,用不用不清楚,这个时候需要加上

import './index.less';

然后index.less里面的样式就可以生效了

.ant-menu-dark.ant-menu-dark:not(.ant-menu-horizontal) .ant-menu-item-selected{
    
    
    background-color:#2970FF;
}

猜你喜欢

转载自blog.csdn.net/qq_41160739/article/details/119005403