fix link to dom in components
This commit is contained in:
parent
809a0b8014
commit
9cc97a4214
1 changed files with 4 additions and 2 deletions
|
|
@ -58,11 +58,13 @@ export function CustomComponent<T extends ConstructorFunction<AbstractComponent>
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply any specified CSS classes to the component root element
|
// Apply any specified CSS classes to the component root element
|
||||||
|
if (p.cssClasses) {
|
||||||
this.classList.add(...p.cssClasses);
|
this.classList.add(...p.cssClasses);
|
||||||
|
}
|
||||||
|
|
||||||
// Process and link properties specified in __linkedProperties to their DOM elements
|
// Process and link properties specified in __linkedProperties to their DOM elements
|
||||||
for (const requested of this.__linkedProperties ?? []) {
|
for (const requested of this.__linkedProperties ?? []) {
|
||||||
const elt = findRefElement(requested.ref);
|
const elt = findRefElement(requested.ref, this);
|
||||||
if (elt == null) {
|
if (elt == null) {
|
||||||
throw new Error(`ref ${requested.ref} not found`);
|
throw new Error(`ref ${requested.ref} not found`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue