<template>
<a-layout>
<a-layout-header>Header</a-layout-header>
<a-layout-content>
<a-card title="Card Title">
<p>Content of the card</p>
</a-card>
</a-layout-content>
<a-layout-footer>Footer</a-layout-footer>
</a-layout>
</template>
<script>
import { defineComponent } from 'vue';
import { Layout, Card } from 'ant-design-vue';
export default defineComponent({
components: {
ALayout: Layout,
ALayoutHeader: Layout.Header,
ALayoutContent: Layout.Content,
ALayoutFooter: Layout.Footer,
ACard: Card,
},
});
</script>
<style scoped>
/* Add some basic styles */
.ant-layout {
min-height: 100vh;
}
.ant-layout-header,
.ant-layout-footer {
background: #7dbcea;
color: #fff;
}
.ant-layout-content {
background: #fff;
padding: 24px;
margin: 0;
min-height: 280px;
}
</style>
<template>):使用了 Ant Design Vue 的 Layout 组件来创建一个基本的页面布局,包含头部 (Header)、主体 (Content) 和底部 (Footer)。在主体部分放置了一个卡片 (Card)。<script>):使用 Vue 3 的 Composition API (defineComponent) 来定义组件,并引入了 Ant Design Vue 的相关组件(如 Layout 和 Card)。<style scoped>):为页面布局添加了一些基本样式,例如背景颜色和内边距,以确保页面看起来更美观。如果你需要更多功能或有其他问题,请告诉我!
上一篇:vue3使用computed
下一篇:vue3 ref原理
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站