Min's blog

I choose to see the beauties in the world.

导航

hash和history

Posted on 2019-09-02 17:18  Min77  阅读(150)  评论(0编辑  收藏  举报

location.hash="aaa"

history.pushState({},'', "home")

history.replaceState()

history.go(-1)  = history.back()

跳到某一个栈的位置

history.go() 可以正值也可以负值

栈结构,先进后出

history.forward() = history.go(1) 前进一页

<router-link to="/user" tag="li" replace active-ckass="active">user</router-link>
添加replace后,页面无法通过点击返回按钮回退
在router对象中修改{
mode:'history',
linkActiveClass:"active"
}