前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Ant Design Vue 4常用组件

Ant Design Vue 4常用组件

作者头像
码客说
发布2024-08-06 10:43:30
1110
发布2024-08-06 10:43:30
举报
文章被收录于专栏:码客

前言

https://www.antdv.com/docs/vue/getting-started-cn

主题配置

代码语言:javascript
复制
<template>
  <a-config-provider
      :theme="{
      token: {
        colorPrimary: '#FA7E31',
      },
    }"
  >
    <RouterView/>
  </a-config-provider>
</template>

间距

水平

代码语言:javascript
复制
<a-space size="middle">
    <a-button type="primary">搜索</a-button>
    <a-button>重置</a-button>
</a-space>

垂直

代码语言:javascript
复制
<a-space direction="vertical"></a-space>

Button

代码语言:javascript
复制
<a-space>
  <a-button type="primary">搜索</a-button>
  <a-button>重置</a-button>
  <a-button type="dashed">虚线按钮</a-button>
  <a-button type="text">文本按钮</a-button>
  <a-button type="link" danger>删除</a-button>
  <a-popconfirm title="确定要删除吗?" ok-text="Yes" cancel-text="No">
    <a-button type="link" danger>删除</a-button>
  </a-popconfirm>
</a-space>

Card

代码语言:javascript
复制
<a-card style="margin: 0.8rem">
</a-card>

Tab

代码语言:javascript
复制
<a-tabs v-model:activeKey="activeKey">
    <a-tab-pane key="1" tab="全部"></a-tab-pane>
    <a-tab-pane key="2" tab="上架中"></a-tab-pane>
    <a-tab-pane key="3" tab="审核中"></a-tab-pane>
</a-tabs>

TS

代码语言:javascript
复制
const activeKey = ref('1');

Table

代码语言:javascript
复制
<a-table :dataSource="dataSource" :columns="columns"/>

TS

代码语言:javascript
复制
const columns = reactive([
  {
    title: '姓名',
    dataIndex: 'name',
    key: 'name',
  },
  {
    title: '年龄',
    dataIndex: 'age',
    key: 'age',
  },
  {
    title: '住址',
    dataIndex: 'address',
    key: 'address',
  },
])

const dataSource = reactive([
  {
    key: '1',
    name: '胡彦斌',
    age: 32,
    address: '西湖区湖底公园1号',
  },
  {
    key: '2',
    name: '胡彦祖',
    age: 42,
    address: '西湖区湖底公园1号',
  }
])
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2024-08-05,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 前言
  • 主题配置
  • 间距
  • Button
  • Card
  • Tab
  • Table
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档