docs_vue2/one/docs/demo/layout/sticky.vue
xdm cf6ba3b42e
docs: add docs for layout (#18)
Co-authored-by: GU Yiling <justice360@gmail.com>
2022-01-14 12:08:26 +08:00

70 lines
1.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<article>
<div class="mock-window">
<veui-layout style="--dls-layout-header-height: 64px;">
<veui-header sticky>Header</veui-header>
<veui-layout>
<veui-sidebar sticky style="max-height: 320px;">
<div class="center full">Sidebar</div>
</veui-sidebar>
<veui-layout>
<veui-content>
<div class="center" style="height: 800px;">Sidebar</div>
</veui-content>
<veui-footer sticky style="background: #ccc;">Footer背景仅为演示</veui-footer>
</veui-layout>
</veui-layout>
</veui-layout>
</div>
</article>
</template>
<script>
import { Layout, Header, Footer, Sidebar, Content } from 'veui'
export default {
components: {
'veui-layout': Layout,
'veui-header': Header,
'veui-footer': Footer,
'veui-sidebar': Sidebar,
'veui-content': Content
},
data () {
return {
mode: 'slim',
modes: [
{ label: 'slim', value: 'slim' },
{ label: 'hidden', value: 'hidden' }
]
}
}
}
</script>
<style lang="less" scoped>
.mock-window {
height: 384px;
transform: translate(0, 0); // bfc for fixed
overflow: auto;
border: 1px solid #eee;
& > .veui-layout {
min-width: 860px;
}
}
.center,
.veui-layout-header,
.veui-layout-footer,
.veui-layout-content {
display: flex;
align-items: center;
justify-content: center;
}
.full {
height: 100%;
}
</style>