Пишу проект на Nuxt есть необходимость получать гет параметры из URL хочу написать что то типо этого
fetch ({store}) {
let requestPageApi = axios.get('http://localhost:3005/search/?' + this.$route.query).then((res) => { .....
.
Мой код Nuxt.js
import axios from "axios";
export default {
name: "index",
fetch ({store}) {
let requestPageApi = axios.get('http://localhost:3005/search/', { params: { q: this.$route.query.search } }).then((res) => {
store.commit('frontPagePosts', res.data.tours.posts)
store.commit('routePageHead', res.data.head)
// console.log(res.data)
}).catch((error) => {
console.log(error)
})
return requestPageApi
},