[Vuejs]-[Vue warn]: Invalid prop: type check failed for prop "….". Expected String, returned function()

0👍

Update: Accidentally registered the mapGetters in methods instead of computed, that’s why it did not work.

-1👍

Your function parameters seem to be the wrong way around. In your first snippet you are returning a function that takes a parameter state and returns a function that takes a parameter title, when you want to return a state selector (that is, a function that takes state as a parameter).

Try this, just switching the names of the parameters:

[GETTERS.GET_ERROR_BY_MB_ID]: title => state => {
  return state.submitErrors.find(e => e.meta.name === title)?.content
    .titleOfError;
}

Leave a comment