-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
执行redux更新数据报错,component.$store显示值为undefined #2584
Comments
欢迎提交 Issue~ 如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏 如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。 Good luck and happy coding~ |
能否提供一个可以运行的 demo |
Hello~ 您的问题我们无法复现。如果有空的话还请拔冗提供一个简单的复现 demo,否则这个 issue 将在 15 天后被自动关闭。 如果您在这 15 天中更新更多信息自动关闭的流程会自动取消,如有其他问题也可以发起新的 Issue。 Good luck and happy coding~ |
@justbecoder 复现不了。这句话也没看懂,你给的代码也并没有体现: “如果存在执行更新操作,执行更新操作时报component.$store的值是undefined,后续的data就取不到值”。 像你提供的代码一样在 app.js dispatch 一个 action 初始化 userInfo 并没有报错,即使后面再在页面 dispatch 一个 action 修改 userInfo 也没有问题。建议将 CLI 和依赖都升级到最新版本后再试试。 如果还有问题,可以提供完整的 demo 我们跑一下。 |
我也遇到了同样的问题,报错:TypeError: Cannot read property 'data' of undefined 感觉像是在 app.js 里面不能使用 @connect ,在其他页面使用同样的代码,就不会报错。 |
很有帮助,感谢 |
问题描述
第一次进入小程序,读取storage中的userInfo数据,如果存在执行更新操作,执行更新操作时报component.$store的值是undefined,后续的data就取不到值
复现步骤
[复现问题的步骤]
期望行为
中间过程为什么会报错
报错信息
系统信息
The text was updated successfully, but these errors were encountered: