如何知道组件何时加载? [英] How to know when the component is loaded?

查看:29
本文介绍了如何知道组件何时加载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在创建 AngularDart 组件时,我可以使用 ShadowRootAware 并覆盖 onShadowRoot 以确保阴影 dom 已加载并准备好进行操作,如文档所述;

When creating a AngularDart component, I can use ShadowRootAware and override onShadowRoot to be sure that the shadow dom is loaded and ready for manipulation, as described by the docs;

保证当[onShadowRoot]被调用时,那个shadow DOM已加载并准备就绪.

It is guaranteed that when [onShadowRoot] is invoked, that shadow DOM has been loaded and is ready.

但是,如果 useShadowDom 设置为 false,我有什么替代方法可以保证组件或其内容已加载并准备好进行操作?

However, if useShadowDom is set to false, what alternative do I have that guarantees that the component or its content is loaded and ready to be manipulated?

推荐答案

您可以使用相同的方法.即使它说 onShadowRoot 当它应该禁用阴影根时它仍然会被触发.我们上周刚刚在 v0.12 上试过了

You can use the same approach. Even though it says onShadowRoot it's still fired when it should with shadow root disabled. We just tried this last week on v0.12

这篇关于如何知道组件何时加载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆