Skip to content
New issue

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

global里面的数据变化时,触发的周期问题 #23

Open
gaomeng965 opened this issue May 18, 2020 · 2 comments
Open

global里面的数据变化时,触发的周期问题 #23

gaomeng965 opened this issue May 18, 2020 · 2 comments

Comments

@gaomeng965
Copy link

情境:当前页面的某个字段取得是全局里面的字段的值:
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}; }
当前页面的值不会发生变化,需要重新退出页面 ,再进入页面才可以变化

@gaomeng965
Copy link
Author

刚定位了,,,,版本的问题,,,我用的 "herculex": "^0.3.0-alpha.3" 版本的就不起作用,
"herculex": "^0.2.11-beta.2" 就可以,,,,,,,

@bingjianguo
Copy link
Collaborator

推荐生产环境使用 "0.2.15" 版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants