react antd table 根据条件设置列的样式

 

const columns = [
  {
     title: '数量',
     dataIndex: 'num',
     onCell: (record) => {
       if (record.num === '1') {
          return {
             style: {
                background: '#FAFBFB'
              }
          }
       }
     }
   }   
]

 

解决!!

posted @ 2022-06-27 15:13  凹润之之之  阅读(454)  评论(0编辑  收藏  举报