我有以下内容:
如何去除蓝色下划线? 代码如下:
<Link to="first"><MenuItem style={{paddingLeft: 13, textDecoration: 'none'}}> Team 1 </MenuItem></Link>
MenuItem 组件来自http://www.material-ui.com/#/components/menu
最佳答案
我看到您正在使用内联样式。 textDecoration: 'none'
用于 child,实际上它应该在 <Link>
中使用因此:
<Link to="first" style={{ textDecoration: 'none' }}>
<MenuItem style={{ paddingLeft: 13 }}>Team 1</MenuItem>
</Link>
<Link>
本质上会返回一个标准 <a>
标签,这就是我们应用 textDecoration
的原因统治那里。
希望对你有帮助
关于javascript - 如何摆脱 React Router 的 Link 组件的下划线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37669391/