fix(next): scroll to anchor (#653)

pull/688/head
rainkolwa 3 years ago
parent b447f16fc7
commit 9b38af1f86

@ -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 {

Loading…
Cancel
Save