vue同页面传参

54 阅读1分钟
 watch: {
    // 监听query参数变化
    $route (to, from) {
      if (to.query.参数名 !== from.query.参数名) {
            //do some thing here
      }
    }
  },