-
Notifications
You must be signed in to change notification settings - Fork 2
/
02-nesting.html
33 lines (29 loc) · 1.03 KB
/
02-nesting.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!doctype html>
<html lang="en">
<head>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<!-- Easy Installation: https://alpinejs.dev/essentials/installation -->
<script defer src="https://unpkg.com/[email protected]/dist/cdn.min.js"></script>
<title>Alpine.js : Declare & React</title>
</head>
<body>
<!--
Any element can become an Alpine Component.
You can have global components via the Alpine.store() approach.
-->
<div x-data = "{
// Contain reactive properties, functions, or expressions
hello : 'luis'
}">
<div x-data="{
open : true,
toggle(){
this.open = !this.open
}
}">
<span x-text="hello" x-show="open"></span>
<button x-on:click="toggle">Toggle</button>
</div>
</div>
</body>
</html>