0

嗨,我是 Reactjs 和 primereact 的新手https://www.primefaces.org/primereact/#/datatable。绑定表中的数据,我选择了主要的反应数据表。现在我不知道如何在数据表中添加图像标签。

我尝试在列内使用一些图像标签,但这不起作用,它只是扩展了列,但我的图像没有显示。

在这里我粘贴了我的代码

<DataTable ref={(el) => this.dt = el} value={this.state.cars} paginator={true} rows={10} header={header}
        globalFilter={this.state.globalFilter} emptyMessage="No records found" sortMode="multiple">
        <Column field="vin" header="Vin" filter={true} sortable={true} editor={this.vinEditor} editorValidator={this.requiredValidator} style={{height: '3.5em'}}/>
        <Column field="year" header="Year" filter={true} sortable={true} editor={this.yearEditor} style={{height: '3.5em'}}/>
        <Column field="brand" header="Brand" filter={true} filterElement={brandFilter} sortable={true} editor={this.brandEditor} style={{height: '3.5em'}}/>
        <Column field="color" header="Color" filter={true} filterElement={colorFilter} sortable={true} editor={this.colorEditor} style={{height: '3.5em'}} />
        <img src="http://www.macmillandictionaryblog.com/wp-content/uploads/2011/09/wifi.jpg" alt="Smiley face" width="42" height="42"/>
        <input type="image" src="http://www.macmillandictionaryblog.com/wp-content/uploads/2011/09/wifi.jpg" alt="Submit" width="48" height="48"/>
    </DataTable>
4

1 回答 1

1

尝试将body={your desired thing}属性添加到您选择的列

于 2019-09-18T15:13:24.163 回答