Material UI 重写 Input 样式出错

代码:

underline: {
        '&:before': {
            height: 0,
        },
        '&:after': {
            height: 0,
        },
        '&:hover:not($disabled):before': {
            height: 0,
        },
    }

错误:Warning: [JSS] Could not find the referenced rule disabled in Search.

可以确定是 &:hover:not($disabled):before 这句代码有问题,而且去掉 :not($disabled) 错误消失。但是去掉这个就达不到重写样式的效果,样式还是默认样式

所以问题是这个 $disabled 变量如何写才不报错呢

阅读 3k
1 个回答

还有个属性 disableUnderline 可以去掉下划线,不需要重写样式

clipboard.png

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题