Get array parameters from query in Nuxt.js
P粉714780768
P粉714780768 2023-08-28 15:52:55
0
1
500
<p>I am using Nuxt.js (Nuxt version is 2) I have query parameters on my page <code>https://localhost:9000/applicant?period_manual[]=2022-10-09&period_manual[]=2022-10-19</code></p> <p>I need to get the <code>period_manual</code> parameter from the query. </p> <p>If I try this</p> <pre class="brush:php;toolbar:false;">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</pre> <p>How to get the data of period_manual[] from the query request? </p>
P粉714780768
P粉714780768

reply all(1)
P粉038856725

try it

this.$route.query['period_manual[]']
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!