1. vxe-table-plugin-iview
基于 vxe-table 的表格适配插件,用于兼容 iview、view-design 组件库
vxe-table-plugin-iview
Package: vxe-table-plugin-iview
Created by: x-extends
Last modified: Tue, 30 Apr 2024 14:20:31 GMT
Version: 3.3.0
License: MIT
Downloads: 622
Repository: https://github.com/x-extends/vxe-table-plugin-iview

Install

npm install vxe-table-plugin-iview
yarn add vxe-table-plugin-iview

vxe-table-plugin-iview

gitee star
npm version
npm downloads
npm license

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

Compatibility

对应 vxe-table v3 版本

Installing

 npm install xe-utils vxe-table@3 vxe-table-plugin-iview@1 view-design
 // ...
import VXETable from 'vxe-table'
import VXETablePluginIView from 'vxe-table-plugin-iview'
import 'vxe-table-plugin-iview/dist/style.css'
// ...

VXETable.use(VXETablePluginIView)

API

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

属性 描述 类型 可选值 默认值
name 支持的渲染组件 String Input, AutoComplete, InputNumber, Rate, iSwitch, Button, Buttons
props 渲染组件附加属性,参数请查看被渲染的 Component props Object {}
options 只对 name=Select 有效,下拉组件选项列表 Array []
optionProps 只对 name=Select 有效,下拉组件选项属性参数配置 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 支持的渲染组件 String Input, AutoComplete, InputNumber, Select, Cascader, DatePicker, TimePicker, Rate, iSwitch, Button, Buttons
props 渲染组件附加属性,参数请查看被渲染的 Component props Object {}
options 只对 name=Select 有效,下拉组件选项列表 Array []
optionProps 只对 name=Select 有效,下拉组件选项属性参数配置 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 支持的渲染组件 String Input, AutoComplete, InputNumber, Select, Rate, iSwitch
props 渲染组件附加属性,参数请查看被渲染的 Component props Object {}
options 只对 name=Select 有效,下拉组件选项列表 Array []
optionProps 只对 name=Select 有效,下拉组件选项属性参数配置 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 支持的渲染组件 String Input, AutoComplete, InputNumber, Select, Rate, iSwitch, Radio, Checkbox, Button, Buttons
props 渲染组件附加属性,参数请查看被渲染的 Component props Object {}
options 只对 name=Select 有效,下拉组件选项列表 Array []
optionProps 只对 name=Select 有效,下拉组件选项属性参数配置 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 }">
      <i-input v-model="row.name"></i-input>
    </template>
  </vxe-column>
  <vxe-column field="age" title="Age" :edit-render="{}">
    <template #edit="{ row }">
      <i-input-number v-model="row.age"></i-input-number>
    </template>
  </vxe-column>
  <vxe-column field="date" title="Date" width="200" :edit-render="{}">
    <template #edit="{ row }">
      <i-date-picker v-model="row.date" type="date"></i-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="{}">
    <template #filter="{ $panel, column }">
      <i-input type="type" v-for="(option, index) in column.filters" :key="index" v-model="option.data" @input="$panel.changeOption($event, !!option.data, option)"></i-input>
    </template>
  </vxe-column>
</vxe-table>
 export default {
  data () {
    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

Dependencies

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin