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
Omix 在create.component 创建组件页面的时候,数据被初始化了 #524
Comments
@dntzhang 麻烦了 |
不懂你的目的 |
我的目的很简单,就是在走完异步的时候,我可以拿到之前付给私有变量的值。 |
@fanlei1988 看源码发现,如果用component的方式创建页面的话,框架会在component的ready钩子时,把初始的data重新setData。因为页面的onLoad钩子是在ready钩子调用之前调用的,所以如果在onLoad中有setData的操作,可能就会被之后框架调用的ready给初始化 |
@dntzhang 不知道这里create.component跟create.page在创建页面的时候,为什么不一样? |
This was referenced Nov 27, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
在使用 create.component 创建组件页面的时候,使用onLoad接收参数并赋值给data,在ready或者异步回调的时候data初始化了
实例代码:
请问这种情况怎么处理比较好,因为我需要异步请求之后拿到数据,在处理其他逻辑,同时又需要接收的参数
The text was updated successfully, but these errors were encountered: