我正在将Ionic 4与Angular 8和Rendertron一起使用。
不幸的是,Rendertron无法处理Shadow DOM,而Ionic完全依赖它们。通过Rendertron渲染时,Shadow Dom完全消失了(这是我所期望的),但是Web组件也不包含任何样式,逻辑等。
我已经尝试了ShadyDom,Webcomponentjs和其他Polyfills。他们都不工作。我尝试了另一个项目(不带离子的带有材料的角形),它的工作原理很吸引人。似乎它们适用于自己定义的Web组件,但不适用于Ionic Web组件。
来源 https://github.com/webcomponents/polyfills/tree/master/packages/webcomponentsjs https://github.com/webcomponents/shadydom
是否存在使Rendertron与Ionic一起工作的现有解决方案?
当我同时使用Rendertron或不使用Polyfill时的简短示例(无关紧要):
<!--Ionic Output-->
<ion-button routerLink="/internal-link">My Button</ion-button>
<!--Rendertron Output (exact the same,Rendertron does not change the Web Component)-->
<ion-button routerLink="/internal-link">My Button</ion-button>
<!--Rendertron Output (what I would expect)-->
<a href="/internal-link">
<button class="some-polyfilled-class">My Button</button>
</a>
非常感谢:) 卡斯滕