I'm trying to use qs stringify to encode URL parameters in a Vue Axios call. In my main.js I have the following:
import { createApp } from 'vue'
import Search from './Search.vue'
import axios from 'axios'
import VueAxios from 'vue-axios'
import qs from 'qs'
const search = createApp(Search);
search.use(VueAxios, axios, qs);
search.mount('#v_search_app');
Then in Search.vue, I have the following:
let params = {
"q": this.q,
"page": this.page,
"per_page": this.perPage,
"filters": {
"page": {
"source_table_enum": this.selectedSources
"topic_id": this.selectedTopics
}
}
}
let queryString = this.qs.stringify(params);
This results in the following error:
Uncaught TypeError: Cannot read properties of undefined (reading 'stringify')
What am I doing wrong?