mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-26 08:00:48 +08:00
fix: magic bug with magic wait
This commit is contained in:
@@ -566,7 +566,8 @@ export default {
|
||||
const hash = location.hash
|
||||
if (hash.startsWith('#comment-')) {
|
||||
const id = hash.substring('#comment-'.length)
|
||||
await nextTick()
|
||||
// 不清楚啥原因,先wait一下子不然会定不准 😅
|
||||
await new Promise(resolve => setTimeout(resolve, 500))
|
||||
const el = document.getElementById('comment-' + id)
|
||||
if (el) {
|
||||
const top = el.getBoundingClientRect().top + window.scrollY - headerHeight - 20 // 20 for beauty
|
||||
|
||||
Reference in New Issue
Block a user