docs: separate layout examples (#6526)

This commit is contained in:
云游君 2022-03-11 00:13:29 +08:00 committed by GitHub
parent 5bb0f8cd1c
commit 195224f745
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 145 additions and 96 deletions

View File

@ -25,9 +25,49 @@ These components use flex for layout, so please make sure your browser supports
## Common layouts
<style lang="scss">
@use '../../examples/container/common-layout.scss';
</style>
:::demo
container/basic
container/layout-hm
:::
:::demo
container/layout-hmf
:::
:::demo
container/layout-am
:::
:::demo
container/layout-ham
:::
:::demo
container/layout-hamf
:::
:::demo
container/layout-ahm
:::
:::demo
container/layout-ahmf
:::

View File

@ -1,95 +0,0 @@
<template>
<div class="common-layout">
<el-container>
<el-header>Header</el-header>
<el-main>Main</el-main>
</el-container>
<el-container>
<el-header>Header</el-header>
<el-main>Main</el-main>
<el-footer>Footer</el-footer>
</el-container>
<el-container>
<el-aside width="200px">Aside</el-aside>
<el-main>Main</el-main>
</el-container>
<el-container>
<el-header>Header</el-header>
<el-container>
<el-aside width="200px">Aside</el-aside>
<el-main>Main</el-main>
</el-container>
</el-container>
<el-container>
<el-header>Header</el-header>
<el-container>
<el-aside width="200px">Aside</el-aside>
<el-container>
<el-main>Main</el-main>
<el-footer>Footer</el-footer>
</el-container>
</el-container>
</el-container>
<el-container>
<el-aside width="200px">Aside</el-aside>
<el-container>
<el-header>Header</el-header>
<el-main>Main</el-main>
</el-container>
</el-container>
<el-container>
<el-aside width="200px">Aside</el-aside>
<el-container>
<el-header>Header</el-header>
<el-main>Main</el-main>
<el-footer>Footer</el-footer>
</el-container>
</el-container>
</div>
</template>
<style scoped>
.common-layout .el-header,
.common-layout .el-footer {
background-color: #b3c0d1;
color: var(--el-text-color-primary);
text-align: center;
line-height: 60px;
}
.common-layout .el-footer {
line-height: 60px;
}
.common-layout .el-aside {
background-color: #d3dce6;
color: var(--el-text-color-primary);
text-align: center;
line-height: 200px;
}
.common-layout .el-main {
background-color: #e9eef3;
color: var(--el-text-color-primary);
text-align: center;
line-height: 160px;
}
.common-layout > .el-container {
margin-bottom: 40px;
}
.common-layout .el-container:nth-child(5) .el-aside,
.common-layout .el-container:nth-child(6) .el-aside {
line-height: 260px;
}
.common-layout .el-container:nth-child(7) .el-aside {
line-height: 320px;
}
</style>

View File

@ -0,0 +1,31 @@
.common-layout {
.el-header,
.el-footer,
.el-main,
.el-aside {
display: flex;
justify-content: center;
align-items: center;
}
.el-header,
.el-footer {
background-color: #b3c0d1;
color: var(--el-text-color-primary);
text-align: center;
}
.el-aside {
background-color: #d3dce6;
color: var(--el-text-color-primary);
text-align: center;
}
.el-main {
background-color: #e9eef3;
color: var(--el-text-color-primary);
text-align: center;
height: 150px;
}
}

View File

@ -0,0 +1,11 @@
<template>
<div class="common-layout">
<el-container>
<el-aside width="200px">Aside</el-aside>
<el-container>
<el-header>Header</el-header>
<el-main>Main</el-main>
</el-container>
</el-container>
</div>
</template>

View File

@ -0,0 +1,12 @@
<template>
<div class="common-layout">
<el-container>
<el-aside width="200px">Aside</el-aside>
<el-container>
<el-header>Header</el-header>
<el-main>Main</el-main>
<el-footer>Footer</el-footer>
</el-container>
</el-container>
</div>
</template>

View File

@ -0,0 +1,8 @@
<template>
<div class="common-layout">
<el-container>
<el-aside width="200px">Aside</el-aside>
<el-main>Main</el-main>
</el-container>
</div>
</template>

View File

@ -0,0 +1,11 @@
<template>
<div class="common-layout">
<el-container>
<el-header>Header</el-header>
<el-container>
<el-aside width="200px">Aside</el-aside>
<el-main>Main</el-main>
</el-container>
</el-container>
</div>
</template>

View File

@ -0,0 +1,14 @@
<template>
<div class="common-layout">
<el-container>
<el-header>Header</el-header>
<el-container>
<el-aside width="200px">Aside</el-aside>
<el-container>
<el-main>Main</el-main>
<el-footer>Footer</el-footer>
</el-container>
</el-container>
</el-container>
</div>
</template>

View File

@ -0,0 +1,8 @@
<template>
<div class="common-layout">
<el-container>
<el-header>Header</el-header>
<el-main>Main</el-main>
</el-container>
</div>
</template>

View File

@ -0,0 +1,9 @@
<template>
<div class="common-layout">
<el-container>
<el-header>Header</el-header>
<el-main>Main</el-main>
<el-footer>Footer</el-footer>
</el-container>
</div>
</template>