Laravel  
laravel
文档
数据库
架构
入门
php技术
    
Laravelphp
laravel / php / java / vue / mysql / linux / python / javascript / html / css / c++ / c#

antd vue pro

作者:尛丸子的天真▍我学不会゜   发布日期:2026-08-03   浏览:29

<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 的相关组件(如 LayoutCard)。
  • 样式部分 (<style scoped>):为页面布局添加了一些基本样式,例如背景颜色和内边距,以确保页面看起来更美观。

如果你需要更多功能或有其他问题,请告诉我!

上一篇:vue3使用computed

下一篇:vue3 ref原理

大家都在看

vue.js devtools用法

three.js vue

vue js for循环

vue.min.js 本地引入

vue.js 3

highlight.js vue

vue.config.js 配置

vue.config.js 配置代理

vue.config.js devserv

vue.config.js transpi

Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3

Laravel 中文站