I want to access state.session
in instance.js
from records_view.js
. How is this accomplished?
store/modules/instance.js
In my case, this is how it worked for me.
In file ModuleA.js:
Module A:
export const state = {
parameterInA: 'A'
}
export const action = {
showParameterB() {
console.log("Parameter B is: " + this.state.B. parameterInB)
}
In file ModuleB:
export const state = {
parameterInB: 'B'
}
export const action = {
showParameterA() {
console.log("Parameter A is: " + this.state.A.parameterInA)
}
You will need to import ModuleA & B in the index.js for the root:
import * as A from 'ModuleA.js'
import * as B from 'ModuleB.js'
This way, state parameter can be cross-referenced in sub modules.