react 中的行高不生效且撑的高度变的很大的原因

在JSX中,有一些样式属性是不支持转为px的,比如lineHeight

<div style={
   
   { width: 100, lineHeight: 22 }} />

 这无法被正确解析为行高值

应该这么写

<div style={
   
   { width: 100, lineHeight: '22px' }} />

猜你喜欢

转载自blog.csdn.net/hzxOnlineOk/article/details/108517081
今日推荐