-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path06-init.html
27 lines (25 loc) · 953 Bytes
/
06-init.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
<!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>
<div x-data="{
progress : 0,
init(){
let interval = setInterval(() => {
//if( this.progress >= 100 ) clearInterval( interval);
this.progress = this.progress + 5
}, 200);
}
}">
<progress max="100" :value="progress">
<span x-text="`${progress}%`"></span>
</progress>
<button @click="progress=0">Restart</button>
</div>
</body>
</html>