render的写法

  {
        dataIndex: 'state',
        title: formatMessage({ id: 'state', defaultMessage: '白名单状态' }),
        render:(state,Id)=>(
                  <Popconfirm
                    title={state==1?"确定停用该任务吗?":"确定启用该任务吗?"} okText="确定" cancelText="取消" 
                    onConfirm={()=>this.onSwitch(Id) }
                  >
                    <Switch  checked={state==1}/> 
                     <a style = { {paddingLeft: 6,color:'#666666'}}>{state==1?'启用':'停用'}</a>
                  </Popconfirm>
        )
},

  

posted @ 2020-07-23 19:00  lipu1993  阅读(235)  评论(0)    收藏  举报