Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
116
rated 0 times [  117] [ 1]  / answers: 1 / hits: 30190  / 7 Years ago, sat, february 11, 2017, 12:00:00

How do you access rootState in getters?



const getters = {
getParams: rootState => {
return rootState.route.params
},
}


The above doesn't work. How is this done?


More From » vue.js

 Answers
15

If this getter is in a module rootState is the third arguments.



const getters = {
getParams: (state, getters, rootState) => {
return rootState.route.params
}
}

[#58980] Thursday, February 9, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dominics

Total Points: 424
Total Questions: 99
Total Answers: 107

Location: South Korea
Member since Fri, Sep 11, 2020
4 Years ago
dominics questions
Wed, Apr 6, 22, 00:00, 2 Years ago
Thu, Jan 13, 22, 00:00, 2 Years ago
Fri, Sep 18, 20, 00:00, 4 Years ago
;