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