Material-ui 版式,路由器链接始终带有下划线

Vic*_*aro 4 reactjs react-router material-ui

underline="none"当我向 Typography 元素添加 React-Router 链接时,即使选择了或 ,我似乎也无法摆脱下划线"hover"。

来自 useStyles:

title: {
    display: "none",
    [theme.breakpoints.up("sm")]: {
      display: "block",
    },
  },
Run Code Online (Sandbox Code Playgroud)

来自渲染(Typography 元素位于工具栏中,不确定这是否有影响):

          <Typography
            className={classes.title}
            variant="h6"
            noWrap
            component={Link}
            to="/"
            color="textPrimary"
            underline="none"
          >
            Your Text Here
          </Typography>
Run Code Online (Sandbox Code Playgroud)

在浏览器中: 在此输入图像描述

A W*_*ebb 6

您需要在链接 CSS 中指定以下内容:

textDecoration: "none",
boxShadow: "none"
Run Code Online (Sandbox Code Playgroud)

  • &lt;版式 sx={{ textDecoration: "none" }}&gt; (3认同)