乘风破浪 激流勇进
你好!欢迎来看Tuziki's Planet !

React antdesign 中处理table列内容太多换行

render: (text, record) =>{
    let snArray = [];
    snArray = text.split('+');
    let br = <br/>;
    let result = null;
    if (snArray.length < 2) {
        return text;
    }
    for (let i = 0; i < snArray.length; i++) {
        if (i === 0) {
            result = snArray[i];
        } else {
            result = (<span>{result}{br}{snArray[i]}</span>);
        }
    }
    return <div>{result}</div > ;
}
标签:react
返回列表
返回顶部←