You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes you may want to associate a ref that is nested inside another component with the parent component instead. You can do so by providing a path with the parent components name: `parent/ref`.
290
+
291
+
```html
292
+
<divdata-simple-component="parent">
293
+
<divdata-simple-component="child">
294
+
<buttondata-ref="parent/button">I'm a ref of `parent`</button>
295
+
<buttondata-ref="button">I'm a ref of `child`</button>
296
+
</div>
297
+
</div>
298
+
```
299
+
300
+
Referencing the parent component by it's name as above is the most common scenario, but in some rare cases you may want to target a specific html element. You can do this by using a CSS selector surrounded by parentheses: `(#my-component)/ref` or `(div.some-class)/ref`.
301
+
287
302
### Events
288
303
289
304
Components try to stay as close to native APIs as possible. Therefore events are just [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent), but they can be fully typed:
0 commit comments