From face5476351e77db416f1cb27178988367151167 Mon Sep 17 00:00:00 2001 From: AllenFang Date: Sat, 13 May 2017 15:02:33 +0800 Subject: [PATCH] fix #1301 --- src/Editor.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Editor.js b/src/Editor.js index cb157dca4..caaa032db 100644 --- a/src/Editor.js +++ b/src/Editor.js @@ -37,11 +37,18 @@ const editor = function(editable, attr, format, editorClass, defaultValue, ignor let options = []; const values = editable.options.values; if (Array.isArray(values)) {// only can use arrray data for options - let rowValue; - options = values.map((d, i) => { - rowValue = format ? format(d) : d; + let text; + let value; + options = values.map((option, i) => { + if (typeof option === 'object') { + text = option.text; + value = option.value; + } else { + text = format ? format(option) : option; + value = option; + } return ( - + ); }); }