From 9b38af1f86c3c932724992aa629b1574441210ea Mon Sep 17 00:00:00 2001 From: rainkolwa Date: Mon, 30 May 2022 20:10:33 +0800 Subject: [PATCH] fix(next): scroll to anchor (#653) --- src/client/app/router.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/app/router.ts b/src/client/app/router.ts index 2eca5b7b..a6ad3104 100644 --- a/src/client/app/router.ts +++ b/src/client/app/router.ts @@ -1,4 +1,4 @@ -import { reactive, inject, markRaw, nextTick, readonly } from 'vue' +import { reactive, inject, markRaw, readonly } from 'vue' import type { Component, InjectionKey } from 'vue' import { PageData } from '../shared' import { inBrowser, withBase } from './utils' @@ -89,7 +89,7 @@ export function createRouter( : (readonly(JSON.parse(__pageData)) as PageData) if (inBrowser) { - nextTick(() => { + setTimeout(() => { if (targetLoc.hash && !scrollPosition) { let target: HTMLElement | null = null try {