Vue SSR 重定向时丢失 url #hash

Vue SSR lose url #hash when redirect

Vue.js 应用 SSR。 例如,我有这样的 url 锚点的页面 http://localhost/faq#question5

但是当我 运行 SSR 时它丢失了 url 的散列部分。

来自文档:

return new Promise((resolve, reject) => {
    const { app, router } = createApp()

    // I lose my hash in this place, because I don't have url with hash on server side
    router.push(context.url)
    .....
}

文档在这里: https://ssr.vuejs.org/guide/routing.html#routing-with-vue-router

有什么想法吗?

片段(散列)在发送到服务器时从 URL 中剥离。也许您可以将值转换为参数?在这里查看更多。 https://blog.httpwatch.com/2011/03/01/6-things-you-should-know-about-fragment-urls/