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