<template>
<a-layout>
<a-layout-header>Header</a-layout-header>
<a-layout-content>
<a-button type="primary">Button</a-button>
</a-layout-content>
<a-layout-footer>Footer</a-layout-footer>
</a-layout>
</template>
<script>
import { defineComponent } from 'vue';
import { Layout, Button } from 'ant-design-vue';
export default defineComponent({
components: {
ALayout: Layout,
ALayoutHeader: Layout.Header,
ALayoutContent: Layout.Content,
ALayoutFooter: Layout.Footer,
AButton: Button,
},
});
</script>
<style>
#components-layout-demo-basic {
text-align: center;
}
#components-layout-demo-basic .ant-layout-header,
#components-layout-demo-basic .ant-layout-footer {
background: #7dbcea;
color: #fff;
}
#components-layout-demo-basic .ant-layout-footer {
line-height: 1.5;
}
#components-layout-demo-basic .ant-layout-content {
background: rgba(16, 142, 233, 1);
color: #fff;
min-height: 120px;
line-height: 120px;
}
#components-layout-demo-basic > .ant-layout {
margin-bottom: 48px;
}
#components-layout-demo-basic > .ant-layout:last-child {
margin: 0;
}
</style>
模板部分 (<template>):
ant-design-vue 提供的布局组件 (a-layout, a-layout-header, a-layout-content, a-layout-footer) 来创建一个简单的页面布局。a-button),并设置了按钮类型为 primary。脚本部分 (<script>):
defineComponent 方法来定义组件。ant-design-vue 中的 Layout 和 Button 组件,并在 components 中进行了注册。样式部分 (<style>):
上一篇:vue clipboard
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站