首页 > 技术文章 > react ant-menu-item-selected选中的菜单样式修改

nevertheless 2021-07-22 17:52 原文

之前引入的方式是

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;
}

推荐阅读