<script defer
src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script>
Figure out "your area of concern"
<script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script>
My name is and
I'm years old.
See the Pen Alpine Preso 1 by Raymond Camden (@cfjedimaster) on CodePen.
My name is .
Hi Ray!
I bet you saw Star Wars in the theater!
See the Pen Alpine Preso 2 by Raymond Camden (@cfjedimaster) on CodePen.
See the Pen Alpine Preso Attr by Raymond Camden (@cfjedimaster) on CodePen.
This cat is named
This cat () is
named
See the Pen Alpine Preso 2 by Raymond Camden (@cfjedimaster) on CodePen.
See the Pen Alpine Preso 4 by Raymond Camden (@cfjedimaster) on CodePen.
.number
)
Your name is
Your new name is
See the Pen Alpine Preso 5 by Raymond Camden (@cfjedimaster) on CodePen.
See the Pen Alpine Preso 5 by Raymond Camden (@cfjedimaster) on CodePen.
this
scoped variablesget
modifier is not required.
First Name:
Last Name:
See the Pen Alpine Preso 6 by Raymond Camden (@cfjedimaster) on CodePen.
x-on
<button x-on:click="someFunc">
<button @click="someFunc">
<button @click.prevent="someFunc">
See the Pen Alpine Preso 7 by Raymond Camden (@cfjedimaster) on CodePen.
Photo credit: Aqua Mechanical
alpine:init
event...
See the Pen Alpine Preso 8 by Raymond Camden (@cfjedimaster) on CodePen.
init
or x-init
$watch
or x-effect
$watch('someData', (value, oldValue) => { .... })
x-effect="doSomething(someData)"
alpine:init
alpine:initialized
document.addEventListener('alpine:init', () => {
Alpine.data('myApp', () => ({
async init() {
let resp = await fetch('some cat api url');
let data = await resp.json();
this.cats = data.cats;
},
cats:[]
}))
})
See the Pen Alpine Preso 9 by Raymond Camden (@cfjedimaster) on CodePen.
See the Pen Alpine Preso 3 by Raymond Camden (@cfjedimaster) on CodePen.
See the Pen Image Preview in Alpine.js by Raymond Camden (@cfjedimaster) on CodePen.