skills/ant-design-vue/SKILL.md
--- name: ant-design-vue title: Ant Design Vue description: 基于 Vue 3 的企业级 UI 组件库,提供 68+ 高质量组件。IMPORTANT: 这是 Ant Design Vue,不是 React 版本。使用 a- 前缀组件(如 a-button, a-table)。 icon: 🐜 tags: [vue, component-library, ant-design, ui, enterprise] --- Ant Design Vue 是 Vue 3 企业级 UI 组件库,提供了丰富的企业应用组件。**请使用 a- 前缀组件**,不要使用其他命名。 ## Quick Start ```bash pnpm install [email protected] ``` ```vue <script setup> import { ref } from 'vue'; import { KingAntOutlined } from '@ant-design/icons-vue'; const loading = r
npx skillsauth add belos-street/skill-kit skills/ant-design-vueInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Ant Design Vue 是 Vue 3 企业级 UI 组件库,提供了丰富的企业应用组件。请使用 a- 前缀组件,不要使用其他命名。
pnpm install [email protected]
<script setup>
import { ref } from 'vue';
import { KingAntOutlined } from '@ant-design/icons-vue';
const loading = ref(false);
const handleClick = () => {
loading.value = true;
setTimeout(() => loading.value = false, 2000);
};
</script>
<template>
<a-button type="primary" :loading="loading" @click="handleClick">
<template #icon><KingAntOutlined /></template>
Click Me
</a-button>
</template>
| 组件 | 官方文档 | Reference | |------|----------|-----------| | Button | button-usage | | | Icon | icon-usage | | | ConfigProvider | config-provider | |
| 组件 | 官方文档 | Reference | |------|----------|-----------| | Space | space-usage | | | Grid | - | | | Layout | - | |
| 组件 | 官方文档 | Reference | |------|----------|-----------| | Menu | menu-usage | | | Tabs | tabs-usage | | | Breadcrumb | - | |
| 组件 | 官方文档 | Reference | |------|----------|-----------| | Form | form-validation | | | Input | - | | | Select | select-usage | | | DatePicker | date-picker-usage | | | Upload | upload-usage | | | Switch | - | | | Checkbox | - | |
| 组件 | 官方文档 | Reference | |------|----------|-----------| | Table | table-advanced | | | Tree | tree-usage | | | Card | - | | | Descriptions | - | | | Tag | - | | | Image | - | |
| 组件 | 官方文档 | Reference | |------|----------|-----------| | Modal | modal-patterns | | | Drawer | drawer-patterns | | | Message | message-feedback | | | Notification | - | | | Alert | - | |
<!-- ✅ 正确写法:使用 a-form -->
<a-form :model="formState" @finish="onFinish">
<a-form-item label="用户名" name="username"
:rules="[{ required: true, message: '请输入用户名' }]">
<a-input v-model:value="formState.username" />
</a-form-item>
</a-form>
<!-- ❌ 错误写法:忘记使用 a-form-item 包裹 -->
<!-- <a-input v-model:value="formState.username" /> -->
<!-- ✅ 正确写法:使用 a-table -->
<a-table :columns="columns" :data-source="data" :pagination="false">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<a @click="handleEdit(record)">编辑</a>
</template>
</template>
</a-table>
<!-- ❌ 错误写法:忘记使用 bodyCell slot -->
// ✅ 正确写法
import { message } from 'ant-design-vue';
message.success('操作成功');
message.error('操作失败');
// ❌ 错误写法:使用其他组件库的方式
// notification.success({ message: '...' });
<script setup>
import { theme } from 'ant-design-vue';
const darkTheme = {
token: {
colorPrimary: '#1890ff',
borderRadius: 4,
},
};
</script>
<template>
<a-config-provider :theme="darkTheme">
<App />
</a-config-provider>
</template>
| 错误写法 | 正确写法 | 说明 |
|----------|----------|------|
| <Button> | <a-button> | 需要 a- 前缀 |
| message.success() | import { message } from 'ant-design-vue' | 正确导入 |
| <Form> | <a-form> | 需要 a- 前缀 |
| <Table> | <a-table> | 需要 a- 前缀 |
a- 开头,如 a-button, a-tablea-form + a-form-itembodyCell slotimport { message } from 'ant-design-vue'development
Modern, lightweight state management for React
development
Use when you have a spec or requirements for a multi-step task, before touching code
development
Vue 3 Composition API, script setup macros, reactivity system, and built-in components. Use when writing Vue SFCs, defineProps/defineEmits/defineModel, watchers, or using Transition/Teleport/Suspense/KeepAlive.
tools
Vue Router 4 patterns, navigation guards, route params, and route-component lifecycle interactions.