vue传参之路由传参

query传参 参数会在链接后面显示,刷新不会消失
this.$router.push({ path: "/home", query: { id: 1 }, });
params传参 参数不会显示在链接后面,刷新会消失
      this.$router.push({
        name: "/home",
        params: { id: 1 },
      });
posted @ 2022-10-18 17:04  偷咬亿口月亮  阅读(28)  评论(0)    收藏  举报