How to access URL params in v-router beforeEach block?

Would like to access URL params in vue methodology.
Other than using window.location.href and parsing.

router/index.js

const router = new Router({
  mode: 'hash',
  routes: []
});

router.beforeEach((to, from, next) => {
/*
*WOULD LIKE TO ACCESS THE URL PARAMS HERE*
**to.query** is not working in hash mode.
*/
})

21 thoughts on “How to access URL params in v-router beforeEach block?”

  1. excellent submit, very informative. I’m wondering why the opposite experts of this sector don’t
    notice this. You should continue your writing.

    I’m confident, you have a huge readers’ base already!

    My blog Pharma Labs Keto Review (Georgianna)

    Reply

Leave a Comment