Skip to content

Commit 1611f85

Browse files
committedMar 18, 2025·
fix: delete unused code
1 parent b3c3610 commit 1611f85

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed
 

‎ui/src/pages/Questions/Detail/index.tsx

-3
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,11 @@ const Index = () => {
265265
});
266266
});
267267

268-
// 检查当前URL是否包含锚点,如果有,自动滚动到正确位置
269268
if (window.location.hash) {
270269
const { hash } = window.location;
271270
const targetElement = document.getElementById(hash.substring(1));
272271

273272
if (targetElement) {
274-
// 给浏览器一点时间来完成渲染
275273
setTimeout(() => {
276274
scrollToElementTop(targetElement);
277275
}, 100);
@@ -291,7 +289,6 @@ const Index = () => {
291289
attributeFilter: ['id', 'href'],
292290
});
293291

294-
// 监听 URL hash 变化
295292
const handleHashChange = () => {
296293
if (window.location.hash) {
297294
const { hash } = window.location;

0 commit comments

Comments
 (0)
Please sign in to comment.