Query Parameter tutorial


I would like to add a query string to my route:

    path: '/newModule/:id',
    component: () =>
      import(/* webpackChunkName: "newModule" */ './NewModule/NewModuleId.vue').then((m: any) => m.default),

Say I wanted to add "?user=john to the url?

The docs say:

router.push({ path: '/newModule/:id', query: { user: 'john' }})

should do the trick, but where to put the code? Any good tutorials you can point me to?