We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
情境:当前页面的某个字段取得是全局里面的字段的值: axml : <text>{{$getters.newBalance}}</text> store.js: getters: {newBalance: (state, getters, global) => global.getIn(['newBalance']),}
axml : <text>{{$getters.newBalance}}</text>
store.js: getters: {newBalance: (state, getters, global) => global.getIn(['newBalance']),}
当前页面的点击事件,触发global里面的数据变化时,: js: handleClickBalance() { console.log('test----------'); this.commit('$global:updateState', { newBalance: 125 }); },
js: handleClickBalance() { console.log('test----------'); this.commit('$global:updateState', { newBalance: 125 }); },
全局store: updateState (state, payload) { console.log('state',state) console.log('payload',payload) return { ...state, newBalance: payload.newBalance}; } 当前页面的值不会发生变化,需要重新退出页面 ,再进入页面才可以变化
updateState (state, payload) { console.log('state',state) console.log('payload',payload) return { ...state, newBalance: payload.newBalance}; }
The text was updated successfully, but these errors were encountered:
刚定位了,,,,版本的问题,,,我用的 "herculex": "^0.3.0-alpha.3" 版本的就不起作用, "herculex": "^0.2.11-beta.2" 就可以,,,,,,,
Sorry, something went wrong.
推荐生产环境使用 "0.2.15" 版本
No branches or pull requests
情境:当前页面的某个字段取得是全局里面的字段的值:
axml : <text>{{$getters.newBalance}}</text>
store.js: getters: {newBalance: (state, getters, global) => global.getIn(['newBalance']),}
当前页面的点击事件,触发global里面的数据变化时,:
js: handleClickBalance() { console.log('test----------'); this.commit('$global:updateState', { newBalance: 125 }); },
全局store:
updateState (state, payload) { console.log('state',state) console.log('payload',payload) return { ...state, newBalance: payload.newBalance}; }
当前页面的值不会发生变化,需要重新退出页面 ,再进入页面才可以变化
The text was updated successfully, but these errors were encountered: