Skip to content
Discussion options

You must be logged in to vote

Actually nevermind, I found out.

Though, not sure if this is best way but it's working for me atm. If it can be improved on, please let me know!

Will report back if there are any problems...

// main.js
import { useRoute } from 'vue-router'

const pinia = createPinia();
pinia.use(({ store }) => {
  store.route = useRoute();
})

app.use(pinia);

// inside your store...
const store = defineStore('myStore', {
  state: () => ({ ... })
  actions: {
    mapUrlQueryParamsToFilters() {
      console.log('route', this.route); // entire route object is here
    }
  }
})

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by blaytenshi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant