Skip to content

Vue-router 偶现在使用$router.go(-1),或者点击浏览器后退按钮 无法渲染页面的问题? #2016

@h330894169

Description

@h330894169

Version

3.0.0

Reproduction link

https://github.com/vuejs/vue-router/tree/dev/examples

Steps to reproduce

这个问题是偶现的,有一定的概率出现,
问题的现象是 $router.push / $router.replace 能够正常的渲染路由页面,
但是使用$router.go(-1),或者点击浏览器后退按钮 无法渲染,
再用$router.push / $router.replace 能继续进入其他路由页面,
控制台无错误,配置很正常,是hash模式的,Chrome浏览器

What is expected?

使用$router.go(-1),或者点击浏览器后退按钮 能正常渲染

What is actually happening?

无法渲染


初步怀疑,那个hashchange和popstate没有绑定成功事件,我在里面打了断点,没有进到断点里面

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions