vue路由跳转

this.$router.go(val) 这里val一般是 number类型 通常是前进或者后退几个层级,在history中增加一个历史记录, 如果为0,则代表刷新当前页;

**this.router.push(param)∗∗这里的param一般是路径名,而且在history中增加一个历史记录,可返回,比如this.router.push(param)** 这里的param一般是路径名,而且在history中增加一个历史记录,可返回,比如this.router.push(param)paramhistorythis.router.push(“/home”)

this.$router.replace(param) 这里的param一般是路径名,代表替换当前路由,无法通过history返回到上一个页面。

Logo

Vue社区为您提供最前沿的新闻资讯和知识内容

更多推荐