angular - ViewEncapsulation.ShadowDom 与 ViewEncapsulation.Native

标签 angular

尝试更改封装时,会出现 Emulated、Native、None 和最后一个新的“ShadowDom”4 个选项。我知道 ViewEncapsulation.Native用于使用 Shadow DOM。

available options for encapsulation

那么使用 ViewEncapsulation.ShadowDom 有什么好处? ?

最佳答案

根据 angular.io , Native现在已弃用,取而代之的是 ShadowDOM执行。更改的原因是Native ViewEncapsulation 使用已弃用的 ShadowDOM 版本,而新版本使用标准的当前版本。 (对于支持它的浏览器)。

关于angular - ViewEncapsulation.ShadowDom 与 ViewEncapsulation.Native,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53805945/

相关文章:

css - 无法在 angular.json 中应用 `omega/theme.css`

javascript - 如何在 Angular 8/9 中进行全局搜索?

Angular 2 组件 - 如何导出接口(interface)?

Angular:在 String 上使用 ngSwitch 包括?

javascript - Firebase Angular 7 身份验证持久性

javascript - Angular 6 : Property 'fromEvent' does not exist on type 'typeof Observable'

angular - 将事件从子组件传递到另一个子组件Angular 7

angular - 错误 : Cannot find module "angularfire2/database-deprecated" appmodule ionic 3, Angularfire2

Angular2如何处理日期管道的值为空

javascript - 如何关闭点击外部的下拉菜单?