Skip to content

Commit 338424f

Browse files
committed
fix #1319
1 parent 7b5f6e7 commit 338424f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Editor.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ const editor = function(editable, attr, format, editorClass, defaultValue, ignor
3535

3636
if (editable.type === 'select') {// process select input
3737
let options = [];
38-
const values = editable.options.values;
38+
const { values, textKey, valueKey } = editable.options;
3939
if (Array.isArray(values)) {// only can use arrray data for options
4040
let text;
4141
let value;
4242
options = values.map((option, i) => {
4343
if (typeof option === 'object') {
44-
text = option.text;
45-
value = option.value;
44+
text = textKey ? option[textKey] : option.text;
45+
value = valueKey ? option[valueKey] : option.value;
4646
} else {
4747
text = format ? format(option) : option;
4848
value = option;

0 commit comments

Comments
 (0)