在写项目的时候遇到了一个路由传参的问题,如何才看能判断传来的参数是否改变 解决办法,直接监听路由参数 watch: { $route() { this.id = this.$route.params.Id; }, }, 直接监听整个路由参数,如果感觉范围太广可以只监听某个参数 watch: { '$route.params.Id'() { console.log("变了"+this.$route.params.sd) this.id = this.$route.params.Id; }, },