Skip to content

Container 布局

用于布局的容器组件。

基础用法

常见页面布局

Header
Main
<template>
  <div style="display: flex; flex-direction: column; gap: 20px">
    <lb-container>
      <lb-header>Header</lb-header>
      <lb-main>Main</lb-main>
    </lb-container>
  </div>
</template>

<style lang="scss" scoped>
.lb-header,
.lb-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.lb-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.lb-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 200px;
}

body > .lb-container {
  margin-bottom: 40px;
}
</style>
Header
Main
Footer
<template>
  <div style="display: flex; flex-direction: column; gap: 20px">
    <lb-container>
      <lb-header>Header</lb-header>
      <lb-main>Main</lb-main>
      <lb-footer>Footer</lb-footer>
    </lb-container>
  </div>
</template>

<style lang="scss" scoped>
.lb-header,
.lb-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.lb-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.lb-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 200px;
}

body > .lb-container {
  margin-bottom: 40px;
}
</style>
Main
<template>
  <div style="display: flex; flex-direction: column; gap: 20px">
    <lb-container>
      <lb-aside width="200px">Aside</lb-aside>
      <lb-main>Main</lb-main>
    </lb-container>
  </div>
</template>

<style lang="scss" scoped>
.lb-header,
.lb-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.lb-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.lb-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 200px;
}

body > .lb-container {
  margin-bottom: 40px;
}
</style>
Main
<template>
  <div style="display: flex; flex-direction: column; gap: 20px">
    <lb-container>
      <lb-aside width="200px">Aside</lb-aside>
      <lb-main>Main</lb-main>
      <lb-aside width="200px">Aside</lb-aside>
    </lb-container>
  </div>
</template>

<style lang="scss" scoped>
.lb-header,
.lb-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.lb-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.lb-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 200px;
}

body > .lb-container {
  margin-bottom: 40px;
}
</style>
Header
Main
<template>
  <div style="display: flex; flex-direction: column; gap: 20px">
    <lb-container>
      <lb-aside width="200px">Aside</lb-aside>
      <lb-container>
        <lb-header>Header</lb-header>
        <lb-main>Main</lb-main>
      </lb-container>
    </lb-container>
  </div>
</template>

<style lang="scss" scoped>
.lb-header,
.lb-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.lb-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.lb-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 200px;
}

body > .lb-container {
  margin-bottom: 40px;
}
</style>
Header
Main
Footer
<template>
  <div style="display: flex; flex-direction: column; gap: 20px">
    <lb-container>
      <lb-header>Header</lb-header>
      <lb-container>
        <lb-aside width="200px">Aside</lb-aside>
        <lb-main>Main</lb-main>
      </lb-container>
      <lb-footer>Footer</lb-footer>
    </lb-container>
  </div>
</template>

<style lang="scss" scoped>
.lb-header,
.lb-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.lb-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.lb-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 200px;
}

body > .lb-container {
  margin-bottom: 40px;
}
</style>

Container 属性

AttributeDescriptionTypeAccepted ValuesDefault
direction子元素的排列方向stringhorizontal / vertical当子元素中包含 LbHeaderLbFooter 时为 vertical,否则为 horizontal

Header 属性

AttributeDescriptionTypeAccepted ValuesDefault
height顶栏高度string60px

Aside 属性

AttributeDescriptionTypeAccepted ValuesDefault
width侧边栏宽度string300px
AttributeDescriptionTypeAccepted ValuesDefault
height底栏高度string60px