I can not understand what it exactly does according to the documentation.
This documentation is not detailed enough.
Is there an example?
I can not understand what it exactly does according to the documentation.
This documentation is not detailed enough.
Is there an example?
The documentation isn't that deep because what this does isn't that big of a deal, all that this decorator does is create a "shortcut" of sorts for calling querySelector
on the element's root (be it this.shadowRoot
if you're using shadow dom or this
if you're not)
So basically this TS code:
@query('.someClass')
private _someClassElement: Element
is the same as doing this in JS
get _someClassElement() {
return this.shadowRoot.querySelector('.someClass');
// or this.querySelector('.someClass') if you're not using shadow dom
}
© 2022 - 2024 — McMap. All rights reserved.