How to use vuex namespaced getters with arguments?
You can also declare a getter function like this:
feedersById: (state) => rowID => {
if (state.feedersArray.hasOwnProperty(rowId)) {
return state.feedersArray[rowId].map(id => state.feeders[id]);
}
}
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!! :)