1.this.$router.go(val) => 在history记录中前进或者后退val步,当val为0时刷新当前页面。
2.this.$router.push(path) => 在history栈中添加一条新的记录。
本文介绍了Vue.js中两种常用的路由操作方法:使用this.$router.go(val)实现页面前进或后退,及利用this.$router.push(path)添加新的历史记录。前者通过参数val控制前进或后退的步数,后者则直接跳转到指定路径。
1.this.$router.go(val) => 在history记录中前进或者后退val步,当val为0时刷新当前页面。
2.this.$router.push(path) => 在history栈中添加一条新的记录。
转载于:https://www.cnblogs.com/luyuefeng/p/8618944.html
6146
3072

被折叠的 条评论
为什么被折叠?