离子角 - ng-content / content-procotion Change界面的表示

发布于 2025-02-12 15:34:02 字数 879 浏览 0 评论 0原文

我有一个与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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文