“HTML”:
<MenuItem>
<NextLink className={currentRoute == "/" ? "link--is-active" : ""} href={"/"}>
HOME
</NextLink>
</MenuItem>
嵌入的锚被MUI填充包围,当点击锚外的导航链接时,你会得到很好的mui效果,但url不会改变。如何将NextLink设置为MUI MenuItem的全宽和全高?
Image showing the padding i want on the NextLink not the MUI wrapper
我尝试将MUI元素sx prop的padding和lineHeight分别设置为0和1,但对垂直填充没有影响
1条答案
按热度按时间fruv7luv1#
反转嵌套,一切正常: