Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

hjortur17's avatar

Get Inertia query parameters

Hi, I am having trouble getting the value from my Inertia query parameters. So I have this route: /?filter='units' and I would like to get the value from filter query inside my Vue file. Any ideas how to do that?

I have tried to do this.$route.query.filter but I get $route not found

0 likes
2 replies
tykus's avatar

You can get them directly using the window object; for example, putting them into a URLSearchParams instance that you can easily work with:

let params = new URLSearchParams(window.location.search)
4 likes
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

Why not pass it down to inerita as a prop?

2 likes

Please or to participate in this conversation.