Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Nov 5, 2020
1 parent fbf240e commit fd96c10
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 11 deletions.
68 changes: 58 additions & 10 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,23 +404,26 @@ const renderMap = {
renderEdit: createEditRender(),
renderFilter: createFilterRender(),
filterMethod: defaultFilterMethod,
renderItem: createFormItemRender()
renderItem: createFormItemRender(),
renderItemContent: createFormItemRender()
},
AutoComplete: {
autofocus: 'input.ivu-input',
renderDefault: createEditRender(),
renderEdit: createEditRender(),
renderFilter: createFilterRender(),
filterMethod: defaultFilterMethod,
renderItem: createFormItemRender()
renderItem: createFormItemRender(),
renderItemContent: createFormItemRender()
},
InputNumber: {
autofocus: 'input.ivu-input-number-input',
renderDefault: createEditRender(),
renderEdit: createEditRender(),
renderFilter: createFilterRender(),
filterMethod: defaultFilterMethod,
renderItem: createFormItemRender()
renderItem: createFormItemRender(),
renderItemContent: createFormItemRender()
},
Select: {
renderEdit (h: CreateElement, renderOpts: ColumnEditRenderOptions, params: ColumnEditRenderParams) {
Expand Down Expand Up @@ -562,6 +565,42 @@ const renderMap = {
}, renderOptions(h, options, optionProps))
]
},
renderItemContent (h: CreateElement, renderOpts: FormItemRenderOptions, params: FormItemRenderParams) {
const { options = [], optionGroups, optionProps = {}, optionGroupProps = {} } = renderOpts
const { data, property } = params
const { attrs } = renderOpts
const itemValue = XEUtils.get(data, property)
const props = getItemProps(renderOpts, params, itemValue)
const on = getItemOns(renderOpts, params)
const nativeOn = getNativeOns(renderOpts, params)
if (optionGroups) {
const groupOptions = optionGroupProps.options || 'options'
const groupLabel = optionGroupProps.label || 'label'
return [
h('Select', {
props,
attrs,
on,
nativeOn
}, XEUtils.map(optionGroups, (group, gIndex) => {
return h('OptionGroup', {
key: gIndex,
props: {
label: group[groupLabel]
}
}, renderOptions(h, group[groupOptions], optionProps))
}))
]
}
return [
h('Select', {
props,
attrs,
on,
nativeOn
}, renderOptions(h, options, optionProps))
]
},
cellExportMethod: createExportMethod(getSelectCellValue)
},
Cascader: {
Expand All @@ -570,6 +609,7 @@ const renderMap = {
return cellText(h, getCascaderCellValue(renderOpts, params))
},
renderItem: createFormItemRender(),
renderItemContent: createFormItemRender(),
cellExportMethod: createExportMethod(getCascaderCellValue)
},
DatePicker: {
Expand Down Expand Up @@ -618,18 +658,21 @@ const renderMap = {
return false
},
renderItem: createFormItemRender(),
renderItemContent: createFormItemRender(),
cellExportMethod: createExportMethod(getDatePickerCellValue)
},
TimePicker: {
renderEdit: createEditRender({ transfer: true }),
renderItem: createFormItemRender()
renderItem: createFormItemRender(),
renderItemContent: createFormItemRender()
},
Rate: {
renderDefault: createEditRender(),
renderEdit: createEditRender(),
renderFilter: createFilterRender(),
filterMethod: defaultFilterMethod,
renderItem: createFormItemRender()
renderItem: createFormItemRender(),
renderItemContent: createFormItemRender()
},
iSwitch: {
renderDefault: createEditRender(),
Expand Down Expand Up @@ -657,23 +700,28 @@ const renderMap = {
]
},
filterMethod: defaultFilterMethod,
renderItem: createFormItemRender()
renderItem: createFormItemRender(),
renderItemContent: createFormItemRender()
},
Radio: {
renderItem: createFormItemRadioAndCheckboxRender()
renderItem: createFormItemRadioAndCheckboxRender(),
renderItemContent: createFormItemRadioAndCheckboxRender()
},
Checkbox: {
renderItem: createFormItemRadioAndCheckboxRender()
renderItem: createFormItemRadioAndCheckboxRender(),
renderItemContent: createFormItemRadioAndCheckboxRender()
},
Button: {
renderEdit: defaultButtonEditRender,
renderDefault: defaultButtonEditRender,
renderItem: defaultButtonItemRender
renderItem: defaultButtonItemRender,
renderItemContent: defaultButtonItemRender
},
Buttons: {
renderEdit: defaultButtonsEditRender,
renderDefault: defaultButtonsEditRender,
renderItem: defaultButtonsItemRender
renderItem: defaultButtonsItemRender,
renderItemContent: defaultButtonsItemRender
}
}

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.9.3",
"version": "1.9.4",
"description": "基于 vxe-table 表格的适配插件,用于兼容 iview、view-design 组件库",
"scripts": {
"lib": "gulp build"
Expand Down

0 comments on commit fd96c10

Please sign in to comment.