Evgeny Anisimov
Evgeny Anisimov

Reputation: 49

Get array param from query in Nuxt.js

I am using Nuxt.js (Nuxt version is 2) I have query params on my page https://localhost:9000/applicant?period_manual[]=2022-10-09&period_manual[]=2022-10-19

I need to get period_manual params from query.

If I trying to do

console.log(this.$route.query.period_manual) //- It is undefined
console.log(this.$route.query) //- this outputs {period_manual[]: ["2022-10-16", "2022-10-25"]} 
console.log(this.$route.query.period_manual[]) //- ESLint error - ESLint: Parsing error: An element access expression should take an argument

How I can get data of period_manual[] from query request?

Upvotes: 1

Views: 1230

Answers (1)

kissu
kissu

Reputation: 46604

Give a try to that one

this.$route.query['period_manual[]']

Upvotes: 1

Related Questions