zarewoft / lit-element-snippet

lit-element snippet extension
MIT License
1 stars 2 forks source link

Add query snippet #9

Closed zixsma closed 5 years ago

zixsma commented 5 years ago

I think we need litquery and litqueryall snippets

litquery

Typescript

@query('some-query-string') classProperty: type;

Javascript

get classProperty() {
    return this.shadowRoot.querySelector('some-query-string')
}

litqueryall

Typescript

@queryAll('some-query-string') classProperty: NodeListOf<type>;

Javascript

get classProperty() {
    return this.shadowRoot.querySelectorAll('some-query-string')
}