From 21a565e04ce5fb2db47d2de894ddfe315f76be17 Mon Sep 17 00:00:00 2001 From: yutent Date: Mon, 27 Mar 2023 19:03:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Readme.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index 2f7fdac..c5eaa50 100644 --- a/Readme.md +++ b/Readme.md @@ -1,4 +1,4 @@ -## 9号UI组件库的核心 +## 百搭UI组件库的核心 ### 开发文档 [开发文档](https://github.com/bd-js/core/wiki) @@ -48,7 +48,12 @@ class Hello extends Component { } -customElements.define('wc-hello', Hello) +if (!customElements.get('wc-hello')) { + customElements.define('wc-hello', Hello) +} +// 和上面的写法等价 +// 如果不希望修改前缀`wc-`的话, 可以直接调用内置的reg方法注册组件即可。 +Hello.reg('hello') /*