离子角 - ng-content / content-procotion Change界面的表示
我有一个与HTML的组件,如下所示:
<ion-header>
<header></header>
</ion-header>
<ion-content [fullscreen]="true">
<div>
<tab></tab>
<div class="content">
...
</div>
</div>
</ion-content>
现在我将其更改为一个父母:
<ion-header>
<header></header>
</ion-header>
<ion-content [fullscreen]="true">
<div>
<tab></tab>
<div class="content">
<ng-content></ng-content>
</div>
</div>
</ion-content>
新孩子:
<parent>
...
</parent>
但是现在界面看起来不同,样式不起作用。我习惯于做出反应,因此行为使我感到困惑。我已经尝试添加viewScapsulation.none
,但它不会更改任何内容。理想情况下,我想要的是渲染内容像普通HTML一样工作。
I had a component with html as follows:
<ion-header>
<header></header>
</ion-header>
<ion-content [fullscreen]="true">
<div>
<tab></tab>
<div class="content">
...
</div>
</div>
</ion-content>
Now I change this into a parent-component:
<ion-header>
<header></header>
</ion-header>
<ion-content [fullscreen]="true">
<div>
<tab></tab>
<div class="content">
<ng-content></ng-content>
</div>
</div>
</ion-content>
and the new child:
<parent>
...
</parent>
But now the interface looks different, the styling doesn't work. I'm used to react thus behaviour confuses me. I've tried add ViewEncapsulation.None
but it doesn't change anything. What I ideally want is for the rendered content to work like normal HTML would.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论