# vxe-table-plugin-antd
**Repository Path**: x-extends/vxe-table-plugin-antd
## Basic Information
- **Project Name**: vxe-table-plugin-antd
- **Description**: 基于 vxe-table 表格的适配插件,用于兼容 ant-design-vue 组件库
- **Primary Language**: JavaScript
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 37
- **Forks**: 12
- **Created**: 2019-06-08
- **Last Updated**: 2025-03-13
## Categories & Tags
**Categories**: vue-extensions
**Tags**: None
## README
# vxe-table-plugin-antd
[](https://gitee.com/x-extends/vxe-table-plugin-antd/stargazers)
[](https://www.npmjs.com/package/vxe-table-plugin-antd)
[](http://npm-stat.com/charts.html?package=vxe-table-plugin-antd)
[](LICENSE)
基于 [vxe-table](https://www.npmjs.com/package/vxe-table) 表格的适配插件,用于兼容 [ant-design-vue](https://github.com/vueComponent/ant-design-vue) 组件库
## Compatibility
对应 vxe-table v4 版本
如果您使用的是 vxe-table 4.7+ 最新版本,建议使用更强大的 [@vxe-ui/plugin-render-antd](https://vxeui.com/other4/#/plugin-render-antd/grid/edit/a-input) 适配器,代码完全兼容
## Installing
```shell
npm install vxe-table@next vxe-table-plugin-antd@next ant-design-vue@next
```
```javascript
// ...
import VXETable from 'vxe-table'
import VXETablePluginAntd from 'vxe-table-plugin-antd'
import 'vxe-table-plugin-antd/dist/style.css'
// ...
VXETable.use(VXETablePluginAntd)
```
## API
### cell-render 默认的渲染器配置项说明
| 属性 | 描述 | 类型 | 可选值 | 默认值 |
|------|------|-----|-----|-----|
| name | 支持的渲染组件 | String | AInput, AAutocomplete, AInputNumber, ASwitch, ARate, AButton, AButtons | — |
| props | 渲染组件附加属性,参数请查看被渲染的 Component props | Object | — | {} |
| options | 只对 name=ASelect 有效,下拉组件选项列表 | Array | — | [] |
| optionProps | 只对 name=ASelect 有效,下拉组件选项属性参数配置 | Object | — | { value: 'value', label: 'label' } |
| optionGroups | 只对 name=ASelect 有效,下拉组件分组选项列表 | Array | — | [] |
| optionGroupProps | 只对 name=ASelect 有效,下拉组件分组选项属性参数配置 | Object | — | { options: 'options', label: 'label' } |
| events | 渲染组件附加事件,参数为 ( {row,rowIndex,column,columnIndex}, ...Component arguments ) | Object | — | — |
| nativeEvents | 渲染组件附加事件,参数为 ( {row,rowIndex,column,columnIndex}, ...Component arguments ) | Object | — | — |
### edit-render 可编辑渲染器配置项说明
| 属性 | 描述 | 类型 | 可选值 | 默认值 |
|------|------|-----|-----|-----|
| name | 支持的渲染组件 | String | AInput, AAutocomplete, AInputNumber, ASelect, ACascader, ADatePicker, AMonthPicker, ARangePicker, AWeekPicker, ATimePicker, ATreeSelect, ASwitch, ARate, AButton, AButtons | — |
| props | 渲染组件附加属性,参数请查看被渲染的 Component props | Object | — | {} |
| options | 只对 name=ASelect 有效,下拉组件选项列表 | Array | — | [] |
| optionProps | 只对 name=ASelect 有效,下拉组件选项属性参数配置 | Object | — | { value: 'value', label: 'label' } |
| optionGroups | 只对 name=ASelect 有效,下拉组件分组选项列表 | Array | — | [] |
| optionGroupProps | 只对 name=ASelect 有效,下拉组件分组选项属性参数配置 | Object | — | { options: 'options', label: 'label' } |
| events | 渲染组件附加事件,参数为 ( {row,rowIndex,column,columnIndex}, ...Component arguments ) | Object | — | — |
| nativeEvents | 渲染组件附加事件,参数为 ( {row,rowIndex,column,columnIndex}, ...Component arguments ) | Object | — | — |
### filter-render 筛选渲染器配置项说明
| 属性 | 描述 | 类型 | 可选值 | 默认值 |
|------|------|-----|-----|-----|
| name | 支持的渲染组件 | String | AInput, AAutocomplete, AInputNumber, ASelect, ASwitch, ARate | — |
| props | 渲染组件附加属性,参数请查看被渲染的 Component props | Object | — | {} |
| options | 只对 name=ASelect 有效,下拉组件选项列表 | Array | — | [] |
| optionProps | 只对 name=ASelect 有效,下拉组件选项属性参数配置 | Object | — | { value: 'value', label: 'label' } |
| optionGroups | 只对 name=ASelect 有效,下拉组件分组选项列表 | Array | — | [] |
| optionGroupProps | 只对 name=ASelect 有效,下拉组件分组选项属性参数配置 | Object | — | { options: 'options', label: 'label' } |
| events | 渲染组件附加事件,参数为 ( {}, ...Component arguments ) | Object | — | — |
| nativeEvents | 渲染组件附加事件,参数为 ( {}, ...Component arguments ) | Object | — | — |
### item-render 表单-项选渲染器配置项说明
| 属性 | 描述 | 类型 | 可选值 | 默认值 |
|------|------|-----|-----|-----|
| name | 支持的渲染组件 | String | AInput, AAutocomplete, AInputNumber, ASelect, ASwitch, ARate, ARadio, ACheckbox, AButton, AButtons | — |
| props | 渲染组件附加属性,参数请查看被渲染的 Component props | Object | — | {} |
| options | 只对 name=ASelect 有效,下拉组件选项列表 | Array | — | [] |
| optionProps | 只对 name=ASelect 有效,下拉组件选项属性参数配置 | Object | — | { value: 'value', label: 'label' } |
| optionGroups | 只对 name=ASelect 有效,下拉组件分组选项列表 | Array | — | [] |
| optionGroupProps | 只对 name=ASelect 有效,下拉组件分组选项属性参数配置 | Object | — | { options: 'options', label: 'label' } |
| events | 渲染组件附加事件,参数为 ( {}, ...Component arguments ) | Object | — | — |
| nativeEvents | 渲染组件附加事件,参数为 ( {}, ...Component arguments ) | Object | — | — |
## Cell demo
```html
```
```javascript
import { defineComponent } from 'vue'
export default defineComponent({
setup () {
return {
tableData: [
{ id: 100, name: 'test0', age: 28, sex: '1', date: null },
{ id: 101, name: 'test1', age: 32, sex: '0', date: null },
{ id: 102, name: 'test2', age: 36, sex: '1', date: null }
]
}
}
})
```
## Filter demo
```html
```
```javascript
import { defineComponent } from 'vue'
export default defineComponent({
setup () {
return {
tableData: [
{ id: 100, name: 'test0', age: 28, date: null },
{ id: 101, name: 'test1', age: 32, date: null },
{ id: 102, name: 'test2', age: 36, date: null }
]
}
}
})
```
## License
[MIT](LICENSE) © 2019-present, Xu Liangzhan