From 406f581ecfe23a0d5e5c9ee90eecf8fcf0fa1347 Mon Sep 17 00:00:00 2001 From: yutent Date: Tue, 21 Mar 2023 09:48:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B8=83=E5=B0=94=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E7=9A=84attribute=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/index.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 69d884f..69260a1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bd/core", - "version": "1.5.4", + "version": "1.5.5", "type": "module", "description": "百搭UI组件库的核心", "main": "dist/index.js", diff --git a/src/index.js b/src/index.js index 34b5ca6..ae1a6f8 100644 --- a/src/index.js +++ b/src/index.js @@ -181,7 +181,13 @@ export class Component extends HTMLElement { * @param value */ [__attr2prop__](name, value, old) { - let options = this.#getPropOptions(name) + let _name = boolMap[name], + options + if (_name) { + name = _name + } + + options = this.#getPropOptions(name) this[name] = fixedValue(value, options) }