【发布时间】:2020-04-18 20:56:23
【问题描述】:
我正在使用 reactstrap 创建的引导选项卡内添加使用 react-data-grid 组件创建的网格,但该网格在选项卡内未正确显示,只是一条水平线,但是如果我将相同的代码放在选项卡之外,则网格会正确显示
<TabPane tabId="2">
<Container>
<Row>
<Col sm="12" >
<CardTitle>Special Title Treatment</CardTitle>
<Card body style={{ height: '500px'}}>
<CardText>With supporting text below as a natural lead-in to additional content.</CardText>
<Button>Go somewhere</Button>
<DropDownClienti />
{clienteId}
{ultimiGiorni.status === 'loading' &&
<div>Loading...</div>}
{ultimiGiorni.status === 'loaded' &&
<DataGrid
columns={columns}
rows={ultimiGiorni.payload.results}
onRowsUpdate={(evt) => {
//@ts-ignore
let toUpdate = { ...ultimiGiorni.payload.results[evt.fromRow], ...evt.updated};
console.log('evt', evt, 'toUpdate', toUpdate );
}}
/>
}
{ultimiGiorni.status === 'error' && (
<div>Error, the backend moved to the dark side.</div>
)}
</Card>
</Col>
</Row>
</Container>
</TabPane>
如果我以这种方式放置网格不起作用,如果我将它放在 tabContent 之后,我可以正确使用它。 我错过了什么吗?
【问题讨论】:
标签: reactjs reactstrap react-data-grid