|
MagicalCarlOct 2, 2024
1
const anchor = document.getElementById(`example`);
if (anchor) { anchor.scrollIntoView({ behavior: 'smooth', block: 'start' }); } |
|
2
@MagicalCarl 这样变成要自己 handle 这个逻辑了,也没办法通过 https://xxx.com/my/page#example 这样的链接来直接分享某个章节,想找找有没有更优雅、完美的解法
|
|
crysislinuxOct 2, 2024 via Android
3
就 angular 来说应该可以只用 history api 吧,这样就不占用这个东西了
|