From 836d566f558cbd701a3c990a2c292e7a0e68593d Mon Sep 17 00:00:00 2001 From: yutent Date: Tue, 21 Mar 2023 16:45:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E7=BD=AE=E6=B3=A8=E5=86=8C=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/index.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5ef0a1c..a7337c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bd/core", - "version": "1.5.6", + "version": "1.5.7", "type": "module", "description": "百搭UI组件库的核心", "main": "dist/index.js", diff --git a/src/index.js b/src/index.js index 0afd1fd..ac61d35 100644 --- a/src/index.js +++ b/src/index.js @@ -91,6 +91,13 @@ export class Component extends HTMLElement { delete this.props } + static reg(name = '') { + name = 'wc-' + name + if (!customElements.get(name)) { + customElements.define(name, this) + } + } + constructor() { super() this[__pending__] = false