- 移除未使用的YAML锚点定义 - 替换commands字段中的锚点引用为实际值 - 移除有问题的通知步骤 - 修复测试文件中的问题 - 添加新的测试用例和配置文件
This commit is contained in:
@@ -105,16 +105,21 @@ function HeaderContent() {
|
||||
}
|
||||
} else {
|
||||
if (pathname === '/') {
|
||||
const element = document.getElementById(item.id);
|
||||
if (element) {
|
||||
isScrollingRef.current = true;
|
||||
element.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||
window.history.pushState(null, '', `/?section=${item.id}`);
|
||||
|
||||
scrollTimeoutRef.current = setTimeout(() => {
|
||||
isScrollingRef.current = false;
|
||||
}, 1000);
|
||||
}
|
||||
const scrollToSection = (retryCount = 0) => {
|
||||
const element = document.getElementById(item.id);
|
||||
if (element) {
|
||||
isScrollingRef.current = true;
|
||||
element.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||
window.history.pushState(null, '', `/?section=${item.id}`);
|
||||
|
||||
scrollTimeoutRef.current = setTimeout(() => {
|
||||
isScrollingRef.current = false;
|
||||
}, 1000);
|
||||
} else if (retryCount < 10) {
|
||||
setTimeout(() => scrollToSection(retryCount + 1), 100);
|
||||
}
|
||||
};
|
||||
scrollToSection();
|
||||
} else {
|
||||
router.push(`/?section=${item.id}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user