Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
71
rated 0 times [  78] [ 7]  / answers: 1 / hits: 15233  / 6 Years ago, tue, january 23, 2018, 12:00:00

I have issue when Im using vuex.



I have getters in namespaced module and I cant figurę out how to get the data with Ii when Im passing some arguments.



this.$store.getters.feeders.getFeedersById(id)


And in maper.



...mapGetters({
feeders: ['feeders/getFeedersById'](this.id)


Getting error like this getter is not a function. What else shoudl I do?


More From » vuejs2

 Answers
17
feedersById(state) {
return rowId => {
if (state.feedersArray.hasOwnProperty(rowId)) {
return state.feedersArray[rowId].map(id => state.feeders[id]);
}

}
},

feedersId() {
if (this.rowData) {
return this.$store.getters['feeders/feedersById'](this.rowData.ac_id);
}
}


Okey I had some mistake there and now it works properly. Thanks!! :)


[#55393] Friday, January 19, 2018, 6 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jackelyn

Total Points: 303
Total Questions: 103
Total Answers: 102

Location: Turks and Caicos Islands
Member since Sun, Mar 7, 2021
3 Years ago
jackelyn questions
Thu, Apr 8, 21, 00:00, 3 Years ago
Sun, Feb 28, 21, 00:00, 3 Years ago
Mon, May 25, 20, 00:00, 4 Years ago
Thu, Apr 30, 20, 00:00, 4 Years ago
;