Skip to content

Commit c969d97

Browse files
committed
feat(iview3): 适配 iview
1 parent f8b59ce commit c969d97

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

packages/lib/vue2-form-iview3/src/config/widgets/WIDGET_MAP.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ const {
1818
export default {
1919
types: {
2020
boolean: 'el-switch',
21-
string: 'el-input',
22-
number: 'el-input-number',
23-
integer: 'el-input-number',
21+
string: 'i-input',
22+
number: 'input-number',
23+
integer: 'input-number',
2424
},
2525
formats: {
26-
color: 'el-color-picker',
26+
color: 'color-picker',
2727
time: TimePickerWidget, // 20:20:39+00:00
2828
date: DatePickerWidget, // 2018-11-13
2929
'date-time': DateTimePickerWidget, // 2018-11-13T20:20:39+00:00

packages/lib/vue2-form-iview3/src/index.js

+8-10
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ const JsonSchemaForm = createVue2Core(Object.freeze({
2121
form: {
2222
functional: true,
2323
render(h, context) {
24-
const labelWidth = (context.data.props.labelPosition === 'top' || !context.data.props.labelWidth || !context.data.props)
25-
? undefined
26-
: parseFloat(String(context.data.props.labelWidth));
27-
2824
context.data.props = {
2925
...context.data.props,
30-
labelWidth
26+
labelWidth: (context.data.props.labelPosition === 'top' || !context.data.props.labelWidth)
27+
? undefined
28+
: parseFloat(String(context.data.props.labelWidth))
3129
};
3230

3331
return h('i-form', context.data, context.children);
@@ -68,11 +66,11 @@ const JsonSchemaForm = createVue2Core(Object.freeze({
6866
},
6967
}),
7068
ICONS_MAP: Object.freeze({
71-
question: 'el-icon-question',
72-
moveUp: 'el-icon-caret-top',
73-
moveDown: 'el-icon-caret-bottom',
74-
close: 'el-icon-close',
75-
plus: 'el-icon-plus'
69+
question: 'ivu-icon ivu-icon-md-help-circle',
70+
moveUp: 'ivu-icon ivu-icon-md-arrow-round-up',
71+
moveDown: 'ivu-icon ivu-icon-md-arrow-round-down',
72+
close: 'ivu-icon ivu-icon-md-close',
73+
plus: 'ivu-icon ivu-icon-md-add'
7674
})
7775
}));
7876

0 commit comments

Comments
 (0)