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
Copy file name to clipboardExpand all lines: README.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,9 +133,9 @@ You can extract data (and behavior) into reusable functions:
133
133
134
134
```html
135
135
<divx-data="dropdown()">
136
-
<buttonx-on:click="open()">Open</button>
136
+
<buttonx-on:click="open">Open</button>
137
137
138
-
<divx-show="isOpen()"x-on:click.away="close()">
138
+
<divx-show="isOpen()"x-on:click.away="close">
139
139
// Dropdown
140
140
</div>
141
141
</div>
@@ -358,6 +358,8 @@ Adding the `.once` modifier to an event listener will ensure that the listener w
358
358
359
359
This is a helpful alternative to setting ids and using `document.querySelector` all over the place.
360
360
361
+
> Note: you can also bind dynamic values for x-ref: `<span :x-ref="item.id"></span>` if you need to.
362
+
361
363
---
362
364
363
365
### `x-if`
@@ -518,6 +520,9 @@ You can also use `$dispatch()` to trigger data updates for `x-model` bindings. F
518
520
519
521
`$nextTick` is a magic property that allows you to only execute a given expression AFTER Alpine has made its reactive DOM updates. This is useful for times you want to interact with the DOM state AFTER it's reflected any data updates you've made.
0 commit comments