From a811213f854cd3af0616f31e9f261def247e185e Mon Sep 17 00:00:00 2001 From: yutent Date: Fri, 6 Dec 2024 18:44:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 25a8df8..05f9272 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wkit", - "version": "1.12.2", + "version": "1.12.3", "type": "module", "description": "A library for building fast, lightweight web components.", "main": "dist/index.js", diff --git a/src/index.js b/src/index.js index 3b1ce8c..ca46ca7 100644 --- a/src/index.js +++ b/src/index.js @@ -169,8 +169,8 @@ export class Component extends HTMLElement { delete this.props } - static reg(name = '', prefix = 'wc-') { - let key = prefix + name + static reg(name = '', prefix = 'wc') { + let key = prefix + '-' + name if (!customElements.get(key)) { customElements.define(key, this) }