关于vue2.0中 $route和$router

今天在做项目的一个页面路由时,传参这里搞了一整天...... 明明记得this.$router.query(注意这里的query是从router-link中传的)。死活拿不到值。郁闷了一整天,后来才发现 应该是 this.$route.query,route不是router。

返回上一页 用的是this.$router.go(-1),而我错误的认为获取参数也是this.$router中取。其实是从this.$route中取。console发现 this.$routethis.$router这两个都存在

posted @ 2017-11-02 16:37  蛋挞与伯爵  阅读(3107)  评论(0编辑  收藏  举报