vue中监听路由参数的两种方法 第一种 wacth:{ "$route"(to,from){ console.log(to.query.id) } } 第二种 beforeRouteUpdate(to,from,next){ this.stri=to.query.type; next(); }