路由之间的跳转常用的有4种方式
1、<router-link to="需要跳转的路径">
2、this.$router.push()跳转到指定的 url,并在 history 中添加记录,点击回 退返回到上一个页面
3、this.$router.replace()跳转到指定的 url,但是 history 中不会添加记录, 点击回退到上上个页面
4、this.$touter.go(n)向前或者后跳转 n 个页面,n 可以是正数也可以是负数
本文详细介绍了四种常见的Vue Router跳转方式:链接组件、$router.push()、$router.replace()和$router.go(),助你掌握前端路由管理的技巧。
路由之间的跳转常用的有4种方式
1、<router-link to="需要跳转的路径">
2、this.$router.push()跳转到指定的 url,并在 history 中添加记录,点击回 退返回到上一个页面
3、this.$router.replace()跳转到指定的 url,但是 history 中不会添加记录, 点击回退到上上个页面
4、this.$touter.go(n)向前或者后跳转 n 个页面,n 可以是正数也可以是负数

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