从Lit-element组件类定义的方法内部:如何访问子组件的属性?我正在尝试获取/修改孩子的属性值。例如
...
render() {
return html`
<div>
<label for="queryLimit">Query Limit</label>
<input type="number" name="queryLimit" id="queryLimit" value="7" min="1" max="21">
<button @click="${this.changeQueryLimit}">change attributes</button>
</div>
<topics-unicode-tree-core querylimit="9" id="topics-tree"></topics-tree>
`;
}
...
changeQueryLimit() {
let topicsTree = this.shadowRoot.getElementById("topics-tree");
// TODO: console.log(topicsTree.querylimit);
}