-
Notifications
You must be signed in to change notification settings - Fork 152
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
add init data and loadData event callback to be init #1786
Conversation
@pigwing 在OnAfterRender里也要手动延迟吗?你提议的API有点冗余,如果一定需要,可以是一个 [Parameter] public Func<string> DataInitializer { get; set; } |
是的,因为在webview2里面呢,
是不支持的,需要做
用JavaScript进行component渲染,要依赖dom节点,但因为组件们各自的firstRender时间不一致,会导致我页面的firstRender会比drawFlow要早,所以就需要delay一下等待drawFlow渲染完毕以后,再import出现相关的dataflow的dom,这时候才能去用js渲染对应的customer element. |
做成Func也行,只要在dataflow的firstRender时候执行一次import也能正常初始化,这时候我在OnImport的event callback里面做customer element的构建就好 |
刚试了下.这样改还是有加载顺序的问题 |
OnImport在组件初始化的时候会被执行一次,这时候依然找不到相关的dom进行customer element渲染 |
sorry,我错了,这样改就可以了.我测试通过了... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pigwing 代码好像没有修改好? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Description
因为当_drawflowProxy = await DrawflowJSModule.Init(ElementReference.GetSelector()!, _interopHandleReference, Mode);执行后,页面相关dom元素才会被渲染以及事件发生挂钩对接,若当有基础dataflow的json数据,这时候是无法初始化的,增加初始json数据参数以及loadData的event callback,协助初始化,不需要在first render的方法内进行delay.....等待相关dom渲染完成后再初始化控件的json数据..