1
我使用的是一個Angular 2組件,它遵循屬性,並且在Chrome桌面瀏覽器中工作正常。Angular 2 ViewEncapsulation.Native vs ViewEncapsulation.Emulated問題在鉻的iPad和鉻瀏覽器
@Component({
selector: 'some-header',
templateUrl: './someheader.component.html',
styleUrls: ['./someheader.component.scss'],
encapsulation: ViewEncapsulation.Native
})
但在我的iPad上的Chrome瀏覽器,它是給我在頁面加載以下錯誤
hostEI.createShadowRoot is undefined
但是,當我將其更改爲
ViewEncapsulation.Emulated
它開始在我的iPad上運行,但我的UI在桌面上打破了。
我檢查以下鏈接計算器
但我的問題是,我可以根據組件的裝飾一定條件下動態地添加此encapsulation
屬性。
感謝
[網絡組件polyfills(https://www.webcomponents.org/polyfills/)應該做的伎倆 –
感謝這就是我一直在尋找:) – Rishi