From 3c48b273fe07e36dac2f01c5c42121522c2cc3bc Mon Sep 17 00:00:00 2001 From: zsmj1994 Date: Tue, 2 Jun 2020 19:36:16 +0800 Subject: [PATCH] =?UTF-8?q?DEC-13547=20FineUI=20=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=9C=AA=E5=AE=9A=E4=B9=89=E7=9A=84=E6=97=B6=E5=80=99=E6=8A=9B?= =?UTF-8?q?=E5=87=BAshortcut=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 3 +++ src/core/shortcut.js | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index fa5fcd40f..8e588c8e5 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,7 @@ # 更新日志 +2.0(2020-06) +- 增加组件shortcut未定义的错误提示 + 2.0(2020-05) - 修复调用BI.history.navigate(XXX, {trigger: false})时, XXX包含中文空格等字符仍然触发回调的问题 - 新增BI.after和BI.before方法 diff --git a/src/core/shortcut.js b/src/core/shortcut.js index 26769de68..7f2717850 100644 --- a/src/core/shortcut.js +++ b/src/core/shortcut.js @@ -11,6 +11,10 @@ var createWidget = function (config) { var cls = kv[config.type]; + if(!cls){ + throw new Error("组件"+config.type +"未定义"); + } + var widget = new cls(); widget._initProps(config); @@ -72,4 +76,4 @@ return widget.element; }; -})(); \ No newline at end of file +})();