Skip to content

Commit

Permalink
chore(table): 规范代码结构(#3044)
Browse files Browse the repository at this point in the history
  • Loading branch information
wanjinping committed Nov 19, 2024
1 parent 44f90cf commit 1dd16c5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .changeset/moody-bikes-raise.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"@hi-ui/hiui": minor
---

feat(table): 设置滚动位置(#3044)
feat(table): 虚拟列表下,支持设置滚动位置(#3044)
18 changes: 10 additions & 8 deletions packages/ui/table/stories/virtual.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,17 @@ export const Virtual = () => {
return (
<>
<h1>Virtual for Table</h1>
<Button
onClick={() => {
// key 为节点 id
tableRef.current?.scrollTo?.({ key: '小米-1000', align: 'top' })
}}
>
scroll to key: 小米-1000
</Button>
<div className="table-virtual__wrap" style={{ minWidth: 660, background: '#fff' }}>
<div style={{ marginBottom: '1em' }}>
<Button
onClick={() => {
// key 为节点 id
tableRef.current?.scrollTo?.({ key: '小米-1000', align: 'top' })
}}
>
scroll to key: 小米-1000
</Button>
</div>
<Table
fieldKey="name"
columns={column}
Expand Down

0 comments on commit 1dd16c5

Please sign in to comment.