react antd 中table列中内容过长的解决方式

直接上代码


 const jobColumns = [
      {
        title: '单位名称',
        dataIndex: 'jsdw',
        key: 'jsdw',
       // 解决方案一:使用原生的html
       // render: val => {val.substring(0, 10)}
       // 解决方案二:使用ellipsis 属性跟ToolTip 组件结合的方式
         ellipsis: true,
        render: (value, record) => {
          return (
            
              
{value.substring(0, 10)}
); }, }, { title: '录用人数', dataIndex: 'counts', key: 'counts' } ];

你可能感兴趣的:(react,前端)