Home

Issue: 424

Use vuex helper functions

[issue link]

Hi guys, I’m migration my code from vanilla vue.js to nuxt.js. Congrats on this btw.

I’m trying to make use of vuex helper functions like mapActions or mapGetters but I can’t access to the methods. Please consider the following code snippet:

methods: {
  ...mapActions('searchView', {
    searchRequest: actionTypes.SEARCH_REQUEST,
    clearState: actionTypes.SEARCH_CLEAR_STATE,
    setPageSize: actionTypes.SEARCH_PAGE_SIZE_SET
  })
},

fetch (context) {
  const requestParams = context.route.query
  this.searchRequest(requestParams)
},

This returns:

this.searchRequest is not a function

What am I missing here?

This question is available on Nuxt.js community (#c373)