-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
36 lines (29 loc) · 1.17 KB
/
index.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
34
35
36
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Alpine.js Sample Code - Home</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css">
<link rel="stylesheet" href="asset/custom.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/alpine.min.js" defer></script>
</head>
<body>
<div x-data="{ count: 0, loaded: false }" x-init="setTimeout(() => { loaded = true; }, 100)">
<div class="container" :class="{ 'loaded': loaded }" x-show="loaded">
<h1 x-text="'Count: ' + count"></h1>
<button x-on:click="count++">Increment</button>
<button x-on:click="count--">Decrement</button>
<div x-show="count > 0">
<p x-text="'Positive count: ' + count"></p>
</div>
<ul>
<template x-for="item in ['Apple', 'Banana', 'Orange']">
<li x-text="item"></li>
</template>
</ul>
<a href="about.html">Go to About page</a>
</div>
</div>
</body>
</html>