this.$router.go和this.$router.push以及this.$router.replace的区别
vue路由跳转1、this.$router.go(val)这里val一般是 number类型通常是前进或者后退几个层级,在history中增加一个历史记录, 如果为0,则代表刷新当前页;2、this.$router.push(param)这里的param一般是路径名,而且在history中增加一个历史记录,可返回,比如this.$router.push(“/home...
·
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)∗∗这里的param一般是路径名,而且在history中增加一个历史记录,可返回,比如this.router.push(“/home”)
this.$router.replace(param) 这里的param一般是路径名,代表替换当前路由,无法通过history返回到上一个页面。
更多推荐



所有评论(0)