内置注册方法
parent
439287da9c
commit
836d566f55
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@bd/core",
|
"name": "@bd/core",
|
||||||
"version": "1.5.6",
|
"version": "1.5.7",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "百搭UI组件库的核心",
|
"description": "百搭UI组件库的核心",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
|
|
@ -91,6 +91,13 @@ export class Component extends HTMLElement {
|
||||||
delete this.props
|
delete this.props
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static reg(name = '') {
|
||||||
|
name = 'wc-' + name
|
||||||
|
if (!customElements.get(name)) {
|
||||||
|
customElements.define(name, this)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super()
|
super()
|
||||||
this[__pending__] = false
|
this[__pending__] = false
|
||||||
|
|
Loading…
Reference in New Issue