Material-UI Typography带有路由链接始终具有下划线

4

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

来自useStyles:

title: {
    display: "none",
    [theme.breakpoints.up("sm")]: {
      display: "block",
    },
  },

从渲染(Typography元素位于工具栏中,不确定是否有所不同):

          <Typography
            className={classes.title}
            variant="h6"
            noWrap
            component={Link}
            to="/"
            color="textPrimary"
            underline="none"
          >
            Your Text Here
          </Typography>

在浏览器中:

输入图像描述
3个回答

6
您需要在链接CSS中指定以下内容:
textDecoration: "none",
boxShadow: "none"

3
<Typography sx={{ textDecoration: "none" }}> - agustin

4

0

使用textDecoration: 'none'

import Typography from '@mui/material/Typography';
import { Link } from "react-router-dom";

<Typography
    className={classes.title}
    variant="h6"
    noWrap
    component={Link}
    to="/"
    sx={{ textDecoration: 'none' }}
    >
    Dashboard
</Typography>

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接