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