0
                    const bands = this.props.ApplicationContainer.bands;
                    if(bands)   {
                        var bandsHtml = '<Select defaultValue="Select"><Option value="Select">Select</Option>';
                        const listItems = bands.map(function(obj) { 
                           const rObj = {};
                           rObj[obj.id] = obj.band;
                           bandsHtml += '<Option value="'+obj.band+'">'+obj.band+'</Option>';
                           return rObj;
                        });
                        bandsHtml += '</Select>';
                    }   else    {
                        var bandsHtml='';
                    }
                    console.log(bandsHtml);
                return (
                    bandsHtml
                );

该函数返回表中的内容,但请查看此图像: https ://ibb.co/jNBYnk

它在单元格中显示为 HTML。关于如何在 Antd 表中将其呈现为 Select 的任何想法?

4

1 回答 1

0
let bandsHtml = null
if(bands)   {
    bandsHtml =
        <Select defaultValue="Select">
            <Option value="Select">Select</Option>
            {bands.map( (obj,index) => (<Option value={obj.band} key={index}>{obj.band}</Option>)}
        </Select>
}

/de SM0XLK ;-)

于 2017-06-24T15:00:11.407 回答