antd Input标签 添加suffix去除border边框

<div className="oneBoxTitle">
     嗷嗷 : 
     <Input 
        defaultValue={item.name} 
        style={{flex:"1",marginLeft:"10px",border:"0px",marginRight:"5px",outline:"none"}} 
        size="small" 
        onChange={this.onchangeSName} onFocus={this.onfocusS} 
        onBlur={()=>this.onchangeSNameOut(Id)} 
        suffix={<Tooltip title="可编辑" 
        style={{border:"3px solid pink",}}> <Icon type="edit" style={{ color: 'rgba(0,0,0,.45)' }} /> </Tooltip>}
     /> 
</div>

用了border:"0px",border:"none",outline:"none"都没有用啊
但是去掉suffix就没有border了
那使用suffix的时候怎么清除border

阅读 4.5k
1 个回答

加了suffix以后Input对应的dom结构变成了

<span>
    <input />
</span>

没有suffix直接是

<input />

可以这样

// js 
<Input 
      className={style.item} 
 /> 
 // css
 .item{
    input{
        border: none !important;
    }
 }
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题