-
Notifications
You must be signed in to change notification settings - Fork 131
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
传参并返回上一页时数据没变化 #24
Comments
通过 而小程序全局方法 在不得不使用 let pages = getCurrentPages()
let prevPage = pages[pages.length - 2]
- prevPage.setData({
+ prevPage.__tina_instance__.setData({
test: 'some test',
}) |
通常如果需要跨页面修改 / 访问数据,推荐引入全局状态管理器(如 Redux),而避免使用 |
v1.5.0 released. 现在你也可以通过 相关文档: |
上一页定义的数据:
当前页设置上一页数据:
上一页如果在wxml里有用到 {{ test }} ,数据确实发生了变化 ,但是当返回上一页时,console.log(this.data.test) 结果却是默认值 null 没有变化
用原来的 Page({}) 打印data数据是有变化的,用了 Page.define({}) 数据就为null了
The text was updated successfully, but these errors were encountered: