4.0.4 • Published 8 months ago

vxe-table-plugin-element v4.0.4

Weekly downloads
911
License
MIT
Repository
github
Last release
8 months ago

vxe-table-plugin-element

gitee star npm version npm downloads npm license

基于 vxe-table 表格的适配插件,用于兼容 element-plus 组件库

Compatibility

对应 vxe-table v4 版本

Installing

npm install vxe-table@next vxe-table-plugin-element@next element-plus
// ...
import VXETable from 'vxe-table'
import VXETablePluginElement from 'vxe-table-plugin-element'
import 'vxe-table-plugin-element/dist/style.css'
// ...

VXETable.use(VXETablePluginElement)

API

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

属性描述类型可选值默认值
name支持的渲染组件StringElInput, ElAutocomplete, ElInputNumber, ElSwitch, ElRate, ElSlider, ElButton, ElButtons
attrs渲染组件附加属性,参数请查看被渲染的 Component attrsObject{}
props渲染组件附加属性,参数请查看被渲染的 Component propsObject{}
options只对 name=ElSelect 有效,下拉组件选项列表Array[]
optionProps只对 name=ElSelect 有效,下拉组件选项属性参数配置Object{ value: 'value', label: 'label' }
optionGroups只对 name=ElSelect 有效,下拉组件分组选项列表Array[]
optionGroupProps只对 name=ElSelect 有效,下拉组件分组选项属性参数配置Object{ options: 'options', label: 'label' }
events渲染组件附加事件,参数为 ( {row,rowIndex,column,columnIndex}, ...Component arguments )Object
nativeEvents渲染组件附加事件,参数为 ( {row,rowIndex,column,columnIndex}, ...Component arguments )Object

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

属性描述类型可选值默认值
name支持的渲染组件StringElInput, ElAutocomplete, ElInputNumber, ElSelect, ElCascader, ElTimeSelect, ElTimePicker, ElDatePicker, ElSwitch, ElRate, ElSlider, ElButton, ElButtons
attrs渲染组件附加属性,参数请查看被渲染的 Component attrsObject{}
props渲染组件附加属性,参数请查看被渲染的 Component propsObject{}
options只对 name=ElSelect 有效,下拉组件选项列表Array[]
optionProps只对 name=ElSelect 有效,下拉组件选项属性参数配置Object{ value: 'value', label: 'label' }
optionGroups只对 name=ElSelect 有效,下拉组件分组选项列表Array[]
optionGroupProps只对 name=ElSelect 有效,下拉组件分组选项属性参数配置Object{ options: 'options', label: 'label' }
events渲染组件附加事件,参数为 ( {row,rowIndex,column,columnIndex}, ...Component arguments )Object
nativeEvents渲染组件附加事件,参数为 ( {row,rowIndex,column,columnIndex}, ...Component arguments )Object

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

属性描述类型可选值默认值
name支持的渲染组件StringElInput, ElInputNumber, ElAutocomplete, ElSelect, ElDatePicker, ElSwitch, ElRate, ElSlider
attrs渲染组件附加属性,参数请查看被渲染的 Component attrsObject{}
props渲染组件附加属性,参数请查看被渲染的 Component propsObject{}
options只对 name=ElSelect 有效,下拉组件选项列表Array[]
optionProps只对 name=ElSelect 有效,下拉组件选项属性参数配置Object{ value: 'value', label: 'label' }
optionGroups只对 name=ElSelect 有效,下拉组件分组选项列表Array[]
optionGroupProps只对 name=ElSelect 有效,下拉组件分组选项属性参数配置Object{ options: 'options', label: 'label' }
events渲染组件附加事件,参数为 ( {}, ...Component arguments )Object
nativeEvents渲染组件附加事件,参数为 ( {}, ...Component arguments )Object

item-render 表单-项渲染器配置项说明

属性描述类型可选值默认值
name支持的渲染组件StringElInput, ElInputNumber, ElAutocomplete, ElSelect, ElDatePicker, ElSwitch, ElRate, ElSlider, ElRadio, ElCheckbox, ElButton, ElButtons
attrs渲染组件附加属性,参数请查看被渲染的 Component attrsObject{}
props渲染组件附加属性,参数请查看被渲染的 Component propsObject{}
options只对 name=ElSelect 有效,下拉组件选项列表Array[]
optionProps只对 name=ElSelect 有效,下拉组件选项属性参数配置Object{ value: 'value', label: 'label' }
optionGroups只对 name=ElSelect 有效,下拉组件分组选项列表Array[]
optionGroupProps只对 name=ElSelect 有效,下拉组件分组选项属性参数配置Object{ options: 'options', label: 'label' }
events渲染组件附加事件,参数为 ( {}, ...Component arguments )Object
nativeEvents渲染组件附加事件,参数为 ( {}, ...Component arguments )Object

Cell demo

<vxe-table
  height="600"
  :data="tableData"
  :edit-config="{trigger: 'click', mode: 'cell'}">
  <vxe-column field="name" title="Name" :edit-render="{}">
    <template #edit="{ row }">
      <el-input v-model="row.name"></el-input>
    </template>
  </vxe-column>
  <vxe-column field="age" title="Age" :edit-render="{}">
    <template #edit="{ row }">
      <el-input-number v-model="row.age"></el-input-number>
    </template>
  </vxe-column>
  <vxe-column field="date" title="Date" width="200" :edit-render="{}">
    <template #edit="{ row }">
      <el-date-picker v-model="row.date" type="date"></el-date-picker>
    </template>
  </vxe-column>
</vxe-table>
export default {
  data () {
    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

<vxe-table
  height="600"
  :data="tableData">
  <vxe-column field="name" title="Name"></vxe-column>
  <vxe-column field="age" title="Age"></vxe-column>
  <vxe-column field="date" title="Date" :filters="[{data: []}]" :filter-render="{name: 'ElDatePicker', props: {type: 'daterange'}}">
    <template #filter="{ $panel, column }">
      <el-input type="type" v-for="(option, index) in column.filters" :key="index" v-model="option.data" @input="$panel.changeOption($event, !!option.data, option)"></el-input>
    </template>
  </vxe-column>
</vxe-table>
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 © 2019-present, Xu Liangzhan

3.3.3

8 months ago

3.3.2

9 months ago

4.0.4

12 months ago

4.0.3

1 year ago

4.0.2

1 year ago

3.3.1

1 year ago

4.0.1

1 year ago

3.3.0

1 year ago

4.0.0

1 year ago

3.1.1

2 years ago

3.1.0

2 years ago

1.12.0

2 years ago

3.0.8

2 years ago

1.13.0

2 years ago

3.0.7

2 years ago

3.0.6

3 years ago

1.11.4

4 years ago

3.0.5

4 years ago

3.0.4

4 years ago

3.0.3

4 years ago

1.11.2

4 years ago

1.11.1

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

1.11.0

4 years ago

3.0.0-beta.1

4 years ago

3.0.0-beta.3

4 years ago

3.0.0-beta.2

4 years ago

3.0.0-beta.5

4 years ago

3.0.0-beta.4

4 years ago

3.0.0

4 years ago

3.0.0-beta.0

4 years ago

1.10.3

4 years ago

1.10.2

4 years ago

1.10.1

5 years ago

1.10.0

5 years ago

1.9.5

5 years ago

1.9.4

5 years ago

1.9.3

5 years ago

1.9.2

5 years ago

1.9.1

5 years ago

1.9.0

5 years ago

1.8.10

5 years ago

1.8.9

5 years ago

1.8.8

5 years ago

1.8.8-beta.0

5 years ago

1.8.7

5 years ago

1.8.6

5 years ago

1.8.5

5 years ago

1.8.4

5 years ago

1.8.3

5 years ago

1.8.2

5 years ago

1.8.1

5 years ago

1.8.0

5 years ago

1.8.0-alpha.0

5 years ago

1.7.2

5 years ago

1.7.1

5 years ago

1.7.0

5 years ago

1.6.6

5 years ago

1.6.5

5 years ago

1.6.4

5 years ago

1.6.3

5 years ago

1.6.2

5 years ago

1.6.1

5 years ago

1.6.0

5 years ago

1.6.0-alpha.2

5 years ago

1.6.0-alpha.1

5 years ago

1.6.0-alpha.0

5 years ago

1.5.14

5 years ago

1.5.13

6 years ago

1.5.12

6 years ago

1.5.11

6 years ago

1.5.10

6 years ago

1.5.9

6 years ago

1.5.8

6 years ago

1.5.7

6 years ago

1.5.6

6 years ago

1.5.5

6 years ago

1.5.4

6 years ago

1.5.3

6 years ago

1.5.2

6 years ago

1.5.1

6 years ago

1.5.0

6 years ago

1.4.5

6 years ago

1.4.4

6 years ago

1.4.3

6 years ago

1.4.2

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.4

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.9.1

6 years ago

0.9.0

6 years ago

0.8.0

6 years ago

0.7.0

6 years ago

0.6.0

6 years ago

0.5.0

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago