修复布尔属性的attribute赋值

pull/1/head 1.5.5
yutent 2023-03-21 09:48:29 +08:00
parent 0eecaa22dc
commit 406f581ecf
2 changed files with 8 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@bd/core",
"version": "1.5.4",
"version": "1.5.5",
"type": "module",
"description": "百搭UI组件库的核心",
"main": "dist/index.js",

View File

@ -181,7 +181,13 @@ export class Component extends HTMLElement {
* @param value<String|Boolean|Number>
*/
[__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)
}