Skip to content

Commit 0cf265b

Browse files
committed
fix: 修复 scrollTo 语法错误
1 parent f94381a commit 0cf265b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/BootstrapBlazor/Components/TreeView/TreeView.razor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function scroll(id, options) {
3232
const el = document.getElementById(id);
3333
const item = el.querySelector(".tree-content.active");
3434
if (item) {
35-
item.parentElement.scrollTo(0, item.offsetTop, options || { behavior: 'smooth' });
35+
item.parentElement.scrollTo({ top: item.offsetTop, left: 0, behavior: options?.behavior ?? 'smooth' });
3636
}
3737
}
3838

0 commit comments

Comments
 (0)