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

bindData覆盖JS插入数据问题 #426

Open
JohnTsaii opened this issue Jul 28, 2023 · 3 comments
Open

bindData覆盖JS插入数据问题 #426

JohnTsaii opened this issue Jul 28, 2023 · 3 comments
Assignees

Comments

@JohnTsaii
Copy link
Collaborator

描述这个问题

  1. 我在js onReady生命周期时,往this.data插入了一条数据a=b
  2. 这个时候this.data 里包含了 a=b
  3. 外部重新bindData 这个时候this.data被覆盖了 a=b 没了,这个时候不会重新触发onReady 我无法再插入一条数据
    这种问题你们那边是如何解决的
@msliu3
Copy link
Collaborator

msliu3 commented Jul 28, 2023

1.bindData是覆盖逻辑,会以新data为准。可以在覆盖之前,手动取出来原有数据(native方式)putAll做一个更新再bindData
2.或者在bindData之后调用用onShow或者onReuse生命周期,在这两个生命周期(js方式)再做赋值逻辑

@JohnTsaii
Copy link
Collaborator Author

JohnTsaii commented Jul 28, 2023

方案二:onReuse 需要手动调用吗,我看iOS bindData的时候是组件内部调用的,Android好像没实现这个逻辑?这个差异是没对齐么

@biezhihua biezhihua self-assigned this Oct 20, 2023
@biezhihua
Copy link
Collaborator

@JohnTsaii JS生命周期我会重新处理

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