Created
March 31, 2020 11:14
-
-
Save monbang/5f9dd073fc82475789330e94559865a3 to your computer and use it in GitHub Desktop.
alpine-1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div x-data="{ count: 0 }"> | |
<button @click="count++">+</button> | |
<button @click="count--">-</button> | |
<span x-text="count"></span> | |
</div> | |
let dataString = document.querySelector('[x-data]').getAttribute('x-data'); | |
let data = eval(`(${dataString})`) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment