From 94e87e463c9c5cbf2d70b5d51dbed59152adcc43 Mon Sep 17 00:00:00 2001 From: dailer Date: Tue, 23 Nov 2021 15:32:24 +0800 Subject: [PATCH] =?UTF-8?q?bi.button,bi.text,=20bi.label,bi.html=5Flabel?= =?UTF-8?q?=E7=AD=89=E6=94=AF=E6=8C=81=E7=9B=B4=E6=8E=A5=E5=86=99text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/h.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/h.js b/src/core/h.js index c3c117f91..5ec9f5112 100644 --- a/src/core/h.js +++ b/src/core/h.js @@ -39,7 +39,13 @@ BI.h = function (type, props, children) { right: children }, props); } + if (children.length === 1 && BI.isKey(children[0])) { + return BI.extend({ + type: type + }, { text: children[0] }, props); + } + return BI.extend({ type: type - }, children.length > 0 ? {items: children} : {}, props); + }, children.length > 0 ? { items: children } : {}, props); };