Lightning Aura 组件未显示完整布局

问题描述

我正在学习 aura 框架,但我遇到了一个问题。我实际上使用带有 4 个字段的嵌套布局,但不知何故它只显示了前 2 个字段。任何人都可以帮我显示所有这 4 个字段吗?

这是我的代码。如您所见,下面有一个评论第 2 行,该评论有两个字段在我的页面上不可见。

组件

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningquickaction" access="global">

    <div class="c-container">
        <lightning:layout multipleRows="true">
            <lightning:layoutItem padding="around-small" size="12">
                <div class="page-section page-header">
                    <h2>General information</h2>
                </div>
            </lightning:layoutItem>
            <lightning:layoutItem padding="around-small" size="12">
                <div class="page-main">
                    <lightning:layout>
                        <lightning:layoutItem padding="around-small" size="6">
                            <div class="slds-p-around_medium lgc-bg">
                                <lightning:input name="firstName" label="First Name" />
                            </div>
                        </lightning:layoutItem>
                        <lightning:layoutItem padding="around-small" size="6">
                            <div class="slds-p-around_medium lgc-bg">
                                <lightning:input name="lastName" label="Last Name" required="true" />
                            </div>
                        </lightning:layoutItem>


                            <!-- This row 2 is not visible -->
        
                            <lightning:layoutItem padding="around-small" size="6">
                                <div class="slds-p-around_medium lgc-bg">
                                    <lightning:input type="email" name="email1" value="abc@domain.com" label="Email" required="true" />
                                </div>
                            </lightning:layoutItem> 
                            <lightning:layoutItem padding="around-small" size="6">
                                <div class="slds-p-around_medium lgc-bg">
                                    <lightning:input type="tel" label="Phone" name="phone" required="true" />
                                </div>
                            </lightning:layoutItem>     
                    </lightning:layout>
                </div>
            </lightning:layoutItem>

            <lightning:layoutItem flexibility="auto" padding="around-small" size="12">
                <div class="page-footer page-section">
                    <h2>Footer</h2>
                </div>
            </lightning:layoutItem>
        </lightning:layout>
    </div>

</aura:component>

CSS

.THIS.c-container {
    border: 1px solid #d8dde6;
    margin: 10px 0 20px 0;
}
.THIS .page-section {
    border: solid 1px #ccc;
    padding: 1rem;
}
.THIS .page-header,.THIS .page-footer {
    height: 50px;
}
.THIS .page-main {
    background: #f8f8f8;
}
.THIS .page-left,.THIS .page-right {
    background: #f0efef;
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)