vue 登录前做校验this.$router.push(location)

有很多按钮在执行跳转之前,还会执行一系列方法,这时可以使用 this.$router.push(location) 来修改 url,完成跳转

例如:登录按钮,点击时需要先判断验证码等是否正确,此时

原文地址:https://www.cnblogs.com/duanzhenzhen/p/10588361.html