Skip to content

Commit

Permalink
Select支持disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Oct 27, 2019
1 parent c1ed42a commit 271a9fd
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ VXETable.use(VXETablePluginIView)
| name | 支持的渲染组件 | String | Input, AutoComplete, InputNumber, Rate, iSwitch ||
| props | 渲染组件附加属性,参数请查看被渲染的 Component props | Object || {} |
| options | 只对 name=Select 有效,下拉组件选项列表 | Array || [] |
| optionProps | 只对 name=Select 有效,下拉组件选项属性参数配置 | Object || { value: 'value', label: 'label' } |
| optionProps | 只对 name=Select 有效,下拉组件选项属性参数配置 | Object || { value: 'value', label: 'label', disabled: 'disabled' } |
| optionGroups | 只对 name=ElSelect 有效,下拉组件分组选项列表 | Array || [] |
| optionGroupProps | 只对 name=ElSelect 有效,下拉组件分组选项属性参数配置 | Object || { options: 'options', label: 'label' } |
| events | 渲染组件附加事件,参数为 ( {row,rowIndex,column,columnIndex}, ...Component arguments ) | Object |||
Expand All @@ -46,7 +46,7 @@ VXETable.use(VXETablePluginIView)
| name | 支持的渲染组件 | String | Input, AutoComplete, InputNumber, Select, Cascader, DatePicker, TimePicker, Rate, iSwitch ||
| props | 渲染组件附加属性,参数请查看被渲染的 Component props | Object || {} |
| options | 只对 name=Select 有效,下拉组件选项列表 | Array || [] |
| optionProps | 只对 name=Select 有效,下拉组件选项属性参数配置 | Object || { value: 'value', label: 'label' } |
| optionProps | 只对 name=Select 有效,下拉组件选项属性参数配置 | Object || { value: 'value', label: 'label', disabled: 'disabled' } |
| optionGroups | 只对 name=ElSelect 有效,下拉组件分组选项列表 | Array || [] |
| optionGroupProps | 只对 name=ElSelect 有效,下拉组件分组选项属性参数配置 | Object || { options: 'options', label: 'label' } |
| events | 渲染组件附加事件,参数为 ( {row,rowIndex,column,columnIndex}, ...Component arguments ) | Object |||
Expand All @@ -58,7 +58,7 @@ VXETable.use(VXETablePluginIView)
| name | 支持的渲染组件 | String | Input, AutoComplete, InputNumber, Select, Rate, iSwitch ||
| props | 渲染组件附加属性,参数请查看被渲染的 Component props | Object || {} |
| options | 只对 name=Select 有效,下拉组件选项列表 | Array || [] |
| optionProps | 只对 name=Select 有效,下拉组件选项属性参数配置 | Object || { value: 'value', label: 'label' } |
| optionProps | 只对 name=Select 有效,下拉组件选项属性参数配置 | Object || { value: 'value', label: 'label', disabled: 'disabled' } |
| optionGroups | 只对 name=ElSelect 有效,下拉组件分组选项列表 | Array || [] |
| optionGroupProps | 只对 name=ElSelect 有效,下拉组件分组选项属性参数配置 | Object || { options: 'options', label: 'label' } |
| events | 渲染组件附加事件,参数为 ( {row,rowIndex,column,columnIndex}, ...Component arguments ) | Object |||
Expand Down
6 changes: 4 additions & 2 deletions dist/index.common.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,13 @@
function renderOptions(h, options, optionProps) {
var labelProp = optionProps.label || 'label';
var valueProp = optionProps.value || 'value';
var disabledProp = optionProps.disabled || 'disabled';
return _xeUtils["default"].map(options, function (item, index) {
return h('Option', {
props: {
value: item[valueProp],
label: item[labelProp]
label: item[labelProp],
disabled: item[disabledProp]
},
key: index
});
Expand Down
2 changes: 1 addition & 1 deletion dist/index.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,13 @@ function defaultFilterMethod ({ option, row, column }: any) {
function renderOptions (h: Function, options: any, optionProps: any) {
let labelProp = optionProps.label || 'label'
let valueProp = optionProps.value || 'value'
let disabledProp = optionProps.disabled || 'disabled'
return XEUtils.map(options, (item: any, index: number) => {
return h('Option', {
props: {
value: item[valueProp],
label: item[labelProp]
label: item[labelProp],
disabled: item[disabledProp]
},
key: index
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vxe-table-plugin-iview",
"version": "1.5.3",
"version": "1.5.4",
"description": "基于 vxe-table 表格的适配插件,用于兼容 iview 组件库",
"scripts": {
"lib": "gulp build"
Expand Down

0 comments on commit 271a9fd

Please sign in to comment.