如何在React Virtualized库表的列中添加图像

问题描述 投票:0回答:1

如何在React虚拟化库表的列中插入图像,我已经尝试添加了列的dataKey属性,但它没有加载,可以解决什么问题

import React, { Component } from 'react';
import { Column, Table, AutoSizer, Grid } from 'react-virtualized';

class TableComponent extends Component{
	state={
		callLogsColumnsData: null
	}
	componentDidMount(){
		this.setState({callLogsColumnsData: this.props.tableData});
	}
	render(){
		return(
			<Table
				sortBy="rank"
				sortDirection="DESC"
				width={width}
				height={820}
				headerHeight={20}
				rowHeight={60}
				headerClassName='call-logs-table-header'
				rowClassName='call-logs-row-table'
				style={{borderBottom: "solid 1px #000"}}
				onRowClick={this.onRowClick}
				rowCount={this.state.callLogsColumnsData.length}
				rowGetter={({ index }) => this.state.callLogsColumnsData[index]}
			>
				<Column
					label='CALL ID'
					dataKey='callId'
					width={100}
					className="table-column"
				/>
			</Table>
		)
	}
}
export default TableComponent;
reactjs
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.