如何摆脱 React Router 的 Link 组件的下划线? [英] How to get rid of underline for Link component of React Router?
本文介绍了如何摆脱 React Router 的 Link 组件的下划线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下几点:
如何去掉蓝色下划线?代码如下:
MenuItem 组件来自 http://www.material-ui.com/#/组件/菜单
解决方案
我看到您正在使用内联样式.textDecoration: 'none'
用在 child 中,实际上它应该在 中使用,例如:
本质上会返回一个标准的
标签,这就是我们在那里应用
textDecoration
规则的原因.>
希望能帮到你
I have the following:
How do I get rid of the blue underline? The code is below:
<Link to="first"><MenuItem style={{paddingLeft: 13, textDecoration: 'none'}}> Team 1 </MenuItem></Link>
The MenuItem component is from http://www.material-ui.com/#/components/menu
解决方案
I see you're using inline styles. textDecoration: 'none'
is used in child, where in fact it should be used inside <Link>
as such:
<Link to="first" style={{ textDecoration: 'none' }}>
<MenuItem style={{ paddingLeft: 13 }}>Team 1</MenuItem>
</Link>
<Link>
will essentially return a standard <a>
tag, which is why we apply textDecoration
rule there.
I hope that helps
这篇关于如何摆脱 React Router 的 Link 组件的下划线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文