My asyncData does not work correctly in Nuxt 2?
async asyncData ({ store, query }) {
const type = query.type || "All";
const search = query.search || "";
await store.dispatch("demos/fetchData", {
type,
search
});
return { type, search };
},
It works very well on Development mode, but Production, it does not work.
When I refresh page at URL: localhost:3000/MyPage?type=Spa. This page redirect to: localhost:3000/MyPage/?type=Spa and now the data is data of "All" page not Spa page.
I do not reassign type and search after asyncData
I expect when i refresh the page this data still there.