Skip to content

Commit 2810ea1

Browse files
committed
update Component class to use node
1 parent dc9b7b8 commit 2810ea1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class Component<T extends HTMLElement = HTMLElement> extends BaseComponen
5757
* @typeParam T Component element type
5858
*/
5959
public select<T extends HTMLElement = HTMLElement>(selectors: string): Component<T> | null {
60-
const element = this.element.querySelector<T>(selectors);
60+
const element = this.node.querySelector<T>(selectors);
6161
if (element == null) return null;
6262
return new Component<T>(element);
6363
}
@@ -70,7 +70,7 @@ export class Component<T extends HTMLElement = HTMLElement> extends BaseComponen
7070
* @typeParam T Component element type
7171
*/
7272
public selectAll<T extends HTMLElement = HTMLElement>(selectors: string): Component<T>[] {
73-
return [...this.element.querySelectorAll<T>(selectors)].map(e => new Component<T>(e));
73+
return [...this.node.querySelectorAll<T>(selectors)].map(e => new Component<T>(e));
7474
}
7575

7676
/**
@@ -99,7 +99,7 @@ export class Component<T extends HTMLElement = HTMLElement> extends BaseComponen
9999
const name: string = args[0];
100100
const value: string = args[1];
101101
const priority: boolean = args[2] ?? false;
102-
this.element.style.setProperty(name, value, priority ? "important" : void 0);
102+
this.node.style.setProperty(name, value, priority ? "important" : void 0);
103103
}
104104
else {
105105
const properties: Record<string, string> = args[0];

0 commit comments

Comments
 (0)