mirror of
https://github.com/archtechx/alpine-reactive.git
synced 2025-12-12 16:34:03 +00:00
Add a second component to the demo
This commit is contained in:
parent
fa09e2822f
commit
e0e95a48b7
1 changed files with 8 additions and 0 deletions
|
|
@ -14,6 +14,14 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>First counter</h2>
|
||||||
|
<div x-data="{ counter: $reactive(window.counter) }">
|
||||||
|
<button @click="counter.count--">-</button>
|
||||||
|
Click count: <span x-text="counter.count"></span>
|
||||||
|
<button @click="counter.count++">+</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2>Second counter</h2>
|
||||||
<div x-data="{ counter: $reactive(window.counter) }">
|
<div x-data="{ counter: $reactive(window.counter) }">
|
||||||
<button @click="counter.count--">-</button>
|
<button @click="counter.count--">-</button>
|
||||||
Click count: <span x-text="counter.count"></span>
|
Click count: <span x-text="counter.count"></span>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue