[Vuejs]-Vuejs passing arguments with a routes href link

0๐Ÿ‘

โœ…

So I ended up doing it like this :

route.js:

{
    path: "/addGoods/:id",
    name: "add goods",
    meta: {
      title: "Add Goods",
    },
    component: () => import("../views/GoodsManagment/AddGoods.vue"),
  },
  {
    path: "/goodsTbl",
    name: "goods tbl",

    meta: {
      title: "Goods Table",
    },
    component: () => import("../views/GoodsManagment/GoodsTbl.vue"),
  },

and to call it , I personally found the Programmatic Navigation easier to use, so :

this.$router.push({name: "add goods", params: { id: 123 }});

Leave a comment