在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ antd 的Table組件內(nèi)放走馬燈Carousel組件應(yīng)該怎么放

antd 的Table組件內(nèi)放走馬燈Carousel組件應(yīng)該怎么放

antd 的Table組件內(nèi)放走馬燈Carousel組件應(yīng)該怎么放

今天在Table里放置圖片,發(fā)現(xiàn)后臺給我的圖片數(shù)據(jù)不止一個,所以打算用走馬燈Carousel來放多張圖片。但無奈怎么放都無法顯示。

我在想會不會是因為有兩個return 的問題

下面是相關(guān)代碼

相關(guān)代碼

const loop = (data) => {
        data.map((item) => {
            console.log(item)
            return <div key='photo'><img src={item} width="200" height="350" alt="現(xiàn)場照片" ></img></div>
        })
    }

/* eslint-disable */
    const columns = [{
        title: '現(xiàn)場時間',
        dataIndex: 'xcsj',
        key: 'xcsj',
    }, {
        title: '狀態(tài)',
        dataIndex: 'zt',
        key: 'zt',
    }, {
        title: '備注',
        dataIndex: 'bz',
        key: 'bz',
        width: 250,
    }, {
        title: '現(xiàn)場照片',
        dataIndex: 'xczp',
        key: 'xczp',
        render: (text, record) => {
            let zzqzps = record.xczp.split(',')
            // console.log(zzqzps)
            return zzqzps == '' ? <div key='xczp'></div> : <Carousel autoplay={true}>{loop(zzqzps)}</Carousel>
        },

    }];

有沒有人知道該怎么改呢?求解

回答
編輯回答
未命名

循環(huán)那邊 return data.map()

然后走馬燈組件外面建議加一個div控制寬度。

<div style={{width: 200}}>
    <Carousel autoplay={true}>{loop(zzqzps)}</Carousel>
</div>
2017年5月28日 06:04