this.$router.currentRoute
this.$router.currentRoute.params.query.fred
- see https://stackoverflow.com/questions/48068520/nuxt-js-how-to-get-route-url-params-in-a-page
You need to pas as an object, as the mutation takes a simple payload. Calling:
commit('SET_ENTRY', { slug, entry: response.data })
Mutation definition:
SET_ENTRY(state, { slug, entry }) {
...
}
this.$route
this.$router.currentRoute
async asyncData(context) {
const query_params = context.route.query;
}