调整attribute定义
parent
6ca5045bd0
commit
58d4277964
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@bd/core",
|
||||
"version": "1.5.2",
|
||||
"version": "1.5.3",
|
||||
"type": "module",
|
||||
"description": "百搭UI组件库的核心",
|
||||
"main": "dist/index.js",
|
||||
|
|
|
@ -318,6 +318,7 @@ class TemplateInstance {
|
|||
} else if (templatePart.type === ELEMENT_PART) {
|
||||
part = new ElementPart(node, this, options)
|
||||
}
|
||||
// console.log(node)
|
||||
if (node.nodeType === 1 && node.getAttribute('ref')) {
|
||||
if (options.host.$refs) {
|
||||
options.host.$refs[node.getAttribute('ref')] = node
|
||||
|
|
|
@ -38,7 +38,7 @@ export class Component extends HTMLElement {
|
|||
this.finalize()
|
||||
|
||||
this[__props__].forEach((options, prop) => {
|
||||
options.attribute && list.push(prop.toLowerCase())
|
||||
list.push(prop.toLowerCase())
|
||||
})
|
||||
return list
|
||||
}
|
||||
|
@ -151,6 +151,7 @@ export class Component extends HTMLElement {
|
|||
let options = this.#getPropOptions(name)
|
||||
|
||||
if (options.attribute === false) {
|
||||
this.removeAttribute(name)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue