4.0.1 • Published 1 month ago

vxe-table-plugin-antd v4.0.1

Weekly downloads
1,878
License
MIT
Repository
github
Last release
1 month ago

vxe-table-plugin-antd

gitee star npm version npm downloads gzip size: JS gzip size: CSS npm license

基于 vxe-table 表格的适配插件,用于兼容 ant-design-vue 组件库

Installing

npm install xe-utils vxe-table vxe-table-plugin-antd ant-design-vue
import Vue from 'vue'
import VXETable from 'vxe-table'
import VXETablePluginAntd from 'vxe-table-plugin-antd'
import 'vxe-table-plugin-antd/dist/style.css'

Vue.use(VXETable)
VXETable.use(VXETablePluginAntd)

API

cell-render 默认的渲染器配置项说明

属性描述类型可选值默认值
name支持的渲染组件StringAInput, AAutocomplete, AInputNumber, ASwitch, ARate
props渲染组件附加属性,参数请查看被渲染的 Component propsObject{}
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

edit-render 可编辑渲染器配置项说明

属性描述类型可选值默认值
name支持的渲染组件StringAInput, AAutocomplete, AInputNumber, ASelect, ACascader, ADatePicker, AMonthPicker, ARangePicker, AWeekPicker, ATimePicker, ATreeSelect, ASwitch, ARate
props渲染组件附加属性,参数请查看被渲染的 Component propsObject{}
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

filter-render 筛选渲染器配置项说明

属性描述类型可选值默认值
name支持的渲染组件StringAInput, AAutocomplete, AInputNumber, ASelect, ASwitch, ARate
props渲染组件附加属性,参数请查看被渲染的 Component propsObject{}
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

Cell demo

默认直接使用 class=vxe-table-antd 既可,当然你也可以不引入默认样式,自行实现样式也是可以的。

<vxe-table
  border
  class="vxe-table-antd"
  height="600"
  :data="tableData"
  :edit-config="{trigger: 'click', mode: 'cell'}">
  <vxe-table-column type="selection" width="60"></vxe-table-column>
  <vxe-table-column type="index" label="Number" width="80"></vxe-table-column>
  <vxe-table-column prop="name" label="AInput" min-width="140" :edit-render="{name: 'AInput'}"></vxe-table-column>
  <vxe-table-column prop="age" label="AInputNumber" width="160" :edit-render="{name: 'AInputNumber', props: {max: 35, min: 18}}"></vxe-table-column>
  <vxe-table-column prop="sex" label="ASelect" width="140" :edit-render="{name: 'ASelect', options: sexList}"></vxe-table-column>
  <vxe-table-column prop="region" label="ACascader" width="200" :edit-render="{name: 'ACascader', props: {options: regionList}}"></vxe-table-column>
  <vxe-table-column prop="date7" label="ADatePicker" width="200" :edit-render="{name: 'ADatePicker', props: {type: 'date', format: 'YYYY/MM/DD'}}"></vxe-table-column>
  <vxe-table-column prop="flag" label="ASwitch" width="100" :edit-render="{name: 'ASwitch', type: 'visible'}"></vxe-table-column>
  <vxe-table-column prop="rate" label="ARate" width="200" :edit-render="{name: 'ARate', type: 'visible'}"></vxe-table-column>
</vxe-table>
export default {
  data () {
    return {
      tableData: [
        {
          id: 100,
          name: 'test',
          age: 26,
          sex: '1',
          region: ['shenzhen'],
          date: null,
          date1: null,
          date2: null,
          rate: 2,
          flag: true
        }
      ],
      sexList: [
        {
          'label': '男',
          'value': '1'
        },
        {
          'label': '女',
          'value': '0'
        }
      ],
      regionList: [
        {
          'label': '深圳',
          'value': 'shenzhen'
        },
        {
          'label': '广州',
          'value': 'guangzhou'
        }
      ]
    }
  }
}

Filter demo

<vxe-table
  border
  height="600"
  :data="tableData">
  <vxe-table-column type="index" width="60"></vxe-table-column>
  <vxe-table-column prop="name" label="Name"></vxe-table-column>
  <vxe-table-column prop="age" label="Age"></vxe-table-column>
  <vxe-table-column prop="date" label="Date" :filters="[{data: []}]" :filter-render="{name: 'AInput'}"></vxe-table-column>
</vxe-table>
export default {
  data () {
    return {
      tableData: [
        {
          id: 100,
          name: 'test',
          age: 26,
          date: null
        }
      ]
    }
  }
}

License

MIT License, 2019-present, Xu Liangzhan

4.0.1

1 month ago

3.3.0

3 months ago

4.0.0

3 months ago

1.12.0

7 months ago

3.0.8

10 months ago

1.13.0

7 months ago

3.0.9

10 months ago

3.1.0

7 months ago

3.0.7

11 months ago

3.0.6

2 years ago

3.0.5

3 years ago

1.11.3

3 years ago

3.0.4

3 years ago

3.0.3

3 years ago

3.0.2

3 years ago

1.11.2

3 years ago

1.11.1

3 years ago

3.0.1

3 years ago

1.11.0

3 years ago

3.0.0

3 years ago

3.0.0-beta.1

3 years ago

3.0.0-beta.3

3 years ago

3.0.0-beta.2

3 years ago

3.0.0-beta.5

3 years ago

3.0.0-beta.4

3 years ago

1.10.4

3 years ago

1.10.3

3 years ago

3.0.0-beta.0

3 years ago

1.10.2

3 years ago

1.10.1

3 years ago

1.10.0

3 years ago

1.9.4

3 years ago

1.9.3

4 years ago

1.9.2

4 years ago

1.9.1

4 years ago

1.9.0

4 years ago

1.8.10

4 years ago

1.8.9

4 years ago

1.8.8

4 years ago

1.8.7

4 years ago

1.8.6

4 years ago

1.8.5

4 years ago

1.8.4

4 years ago

1.8.3

4 years ago

1.8.2

4 years ago

1.8.1

4 years ago

1.8.0

4 years ago

1.8.0-alpha.0

4 years ago

1.7.2

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.5

4 years ago

1.6.4

4 years ago

1.6.3

4 years ago

1.6.2

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.6.0-alpha.0

4 years ago

1.5.10

4 years ago

1.5.9

4 years ago

1.5.8

4 years ago

1.5.7

4 years ago

1.5.6

4 years ago

1.5.5

4 years ago

1.5.4

5 years ago

1.5.3

5 years ago

1.5.2

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.6

5 years ago

1.4.5

5 years ago

1.4.4

5 years ago

1.4.3

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.4

5 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago

0.0.1

5 years ago