- 业务需求:默认选择第一个
- 实现思路:
- state: btnclass=“active”
- 默认选中按钮:className=‘this.state.btnclass’ onClick={()=>{this.setState({btnclass :" "})}
3.在css样式里面修改active的样式
.active {
border-color: #29b7b7;
}
4.右上的图标,antd的Badge,offset设置偏移的位置[右,下]
代码:
// 默认选中
defaultChoose(item: any) {
const {
defaultBtn, curdescription } = this.state
if (item.description === '短信触达') {
return (
<List.Item onClick={
(e) =>