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

求助:为何在onShow调用setData会重复渲染? #16

Open
Vescky opened this issue Jan 22, 2018 · 3 comments
Open

求助:为何在onShow调用setData会重复渲染? #16

Vescky opened this issue Jan 22, 2018 · 3 comments

Comments

@Vescky
Copy link

Vescky commented Jan 22, 2018

大神,求助,如题,我在小程序的onShow里面加载数据,并调用setData;第一次进入正常的,点击进去其他页面,再返回,就发现数据重复了。
用之前不是chunk的版本转换出来是没问题的,但是最新这个转换之后发现了此问题。
qq20180122-155644

@Yi-Frank
Copy link

Yi-Frank commented Jan 22, 2018 via email

@Vescky
Copy link
Author

Vescky commented Jan 23, 2018

不过这样也有问题,比如实现这个逻辑:
用户到资料页面修改昵称,再返回个人中心;如果是在onLoad调用了setData,那么返回回来就不会再次调用,就看不到昵称的变化

@pgfxm
Copy link
Collaborator

pgfxm commented Jan 31, 2018

你用onShow处理应该也没问题啊,只要你覆盖上次的数据那应该显示的就是你的新数据了。你这个在小程序里是正常的么

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

3 participants