rsuite / rsuite-table

A React table component.
https://table.rsuitejs.com/
MIT License
722 stars 133 forks source link

table树表格超过三级节点缩进失效 #416

Closed surongm closed 9 months ago

surongm commented 1 year ago

Versions

https://table.rsuitejs.com/#tree "rsuite-table": "^5.10.2",

`const data = mockTreeData({ limits: [2, 3, 3], labels: layer => { if (layer === 0) { return faker.vehicle.manufacturer(); } else if (layer === 1) { return faker.vehicle.fuel(); } return faker.vehicle.vehicle(); }, getRowData: () => ({ price: faker.commerce.price(10000, 1000000, 0, '$', true), rating: faker.finance.amount(2, 5) }) });

const App = () => { const [tree, setTree] = React.useState(true); return (

{ console.log(isOpen, rowData); }} renderTreeToggle={(icon, rowData) => { if (rowData.children && rowData.children.length === 0) { return ; } return icon; }} onRowClick={rowData => { console.log(rowData); }} > Vehicle 🚗 Rating ⭐️ {rowData => Array.from({ length: rowData.rating }).map((_, i) => ⭐️) } Price 💰

); };

ReactDOM.render();` image

树表格三级的子节点层级没有缩进,树结构不明显。

之前使用是好的,是不是最近升版了还是其他原因

simonguo commented 1 year ago

https://github.com/rsuite/rsuite-table/pull/413 这个PR 导致的新问题,你先使用上一个版本 5.10.1

Edymov commented 1 year ago

413 这个PR 导致的新问题,你先使用上一个版本 5.10.1

I don`t think this can somehow affects tree offests. This PR is only for for fixing adding parentId to rowData and does not change tree rendering logic

simonguo commented 1 year ago

@surongm Fixed in rsuite-table@5.10.3

@Edymov Because the parent node of the parent node cannot be obtained. However, I have rewritten flattenData, you can use the latest version of rsuite-table to check whether the problems you encountered before still exist.

surongm commented 1 year ago

rsuite-table@5.10.3 已经可以了 非常感谢! 请问单使用rsuite 有修改这个问题做升级吗

simonguo commented 1 year ago

rsuite-table@5.10.3 已经可以了 非常感谢! 请问单使用rsuite 有修改这个问题做升级吗

rsuite 每周四/五会升级