gpt4 book ai didi

javascript - 语义 UI React : cannot appear as a child of

转载 作者:行者123 更新时间:2023-11-28 17:08:45 25 4
gpt4 key购买 nike

我正在研究 Semantic UI React Table。我收到错误 <thead> cannot appear as a child of <tbody> 。这是为什么?

<Table fixed>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Company Name</Table.HeaderCell>
<Table.HeaderCell>Primary Phone</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
<Search />
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Row>
<Table.Cell>Apple</Table.Cell>
<Table.Cell>58895895</Table.Cell>
</Table.Row>
</Table.Body>
</Table>

当我包含此代码时会发生这种情况:

<Table.Header>
<Table.Row>
<Table.HeaderCell>
<Search />
</Table.HeaderCell>
</Table.Row>
</Table.Header>

最佳答案

我相信您的问题是<Table.Header>关注<Table.Body> 。将您的代码更改为以下内容:

<Table fixed>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Company Name</Table.HeaderCell>
<Table.HeaderCell>Primary Phone</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.HeaderCell>
<Search />
</Table.HeaderCell>
</Table.Row>
<Table.Row>
<Table.Cell>Apple</Table.Cell>
<Table.Cell>58895895</Table.Cell>
</Table.Row>
</Table.Body>
</Table>

关于javascript - 语义 UI React : <thead> cannot appear as a child of <tbody>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55072002/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com