Dropdown下拉菜单组件自定义样式


我们可以看到鼠标移入(el-dropdown-item)后,文字和背景色会变蓝,若要改变样式颜色,或者自定义或者移除样式可以这样写:

:deep(.el-dropdown-menu__item) {
    background-color: transparent !important;  // 防止背景颜色变化
    color: rgb(143, 140, 143) !important;      // 正常状态下的字体颜色
}

:deep(.el-dropdown-menu__item:hover) {
    background-color: transparent !important;  // 鼠标移入时保持背景颜色
    color: rgb(143, 140, 143) !important;      // 鼠标移入时保持字体颜色
}

:deep(.el-dropdown-menu__item.is-active) {
    background-color: transparent !important;  // 活跃状态下的背景颜色
    color: rgb(143, 140, 143) !important;      // 活跃状态下的字体颜色
}

猜你喜欢

转载自blog.csdn.net/YN2000609/article/details/142918358