首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >避雷针组件没有显示完整的布局

问避雷针组件没有显示完整的布局
EN

Stack Overflow用户
提问于 2021-07-19 09:35:48
回答 1查看 786关注 0票数 0

我正在学习光环框架,但我面临着一个问题。实际上,我使用的是4个字段的嵌套布局,但不知怎么的,它只显示了前2个字段。有谁能帮我展示一下这四个领域吗?

这是我的密码。如您所见,下面有注释第2行,注释中有两个字段在我的页面上不可见。

组件

代码语言:javascript
复制
<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

代码语言:javascript
复制
.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;
}
EN

回答 1

Stack Overflow用户

发布于 2021-10-18 06:43:58

我们指的是闪电的大小:按网格的布局。您可以在您的网格中有多达12列,因此我们选择相应的大小。请用你的代码替换这段代码-

代码语言:javascript
复制
<lightning:layout>
                    <lightning:layoutItem padding="around-small" size="3">
                        <div class="slds-p-around_medium lgc-bg">
                            <lightning:input name="firstName" label="First Name" />
                        </div>
                    </lightning:layoutItem>
                    <lightning:layoutItem padding="around-small" size="3">
                        <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="3">
                            <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="3">
                            <div class="slds-p-around_medium lgc-bg">
                                <lightning:input type="tel" label="Phone" name="phone" required="true" />
                            </div>
                        </lightning:layoutItem>     
                </lightning:layout>

请访问下面的链接,了解更多关于Aura网格的信息。

https://www.lightningdesignsystem.com/utilities/grid/

谢谢

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68438259

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档