vue 中 相同的路由不会跳转,更改路由的办法

 vue 开发的项目,路由跳转的时候,是相同的路由是不会跳转,页面也不会有更新的

 有时候 必须要跳转怎么办,

更改一个参数,num,一直在改变。就可以进入了。

this.$router.push({
    path:'/home',
    query:{
        num: Math.floor(Math.random()*100),
    }
})

怕num可能会有相同的几率
好,那就来个不会相同的,这样index一直自增,就不怕相同了。

data(){
    return {
        index:0,
    }
}


this.$router.push({
    path:'/home',
    query:{
        num: this.index++,
    }
})
原文地址:https://www.cnblogs.com/hill-foryou/p/10623340.html