-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtabs.html
31 lines (23 loc) · 864 Bytes
/
tabs.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<script defer src="alpine.min.js"></script>
<title>Tab/View Switcher</title>
</head>
<body>
<p><a href="index.html">Back to index</a></p>
<h1>Tab or view demo</h1>
<div x-data="{ viewSwitcher: 1 /* Use 0 to set no default */ }">
<button x-on:click="viewSwitcher = 1" type="button">View 1</button>
<button x-on:click="viewSwitcher = 2" type="button">View 2</button>
<button x-on:click="viewSwitcher = 3" type="button">View 3</button>
<div x-show="1 === viewSwitcher"><p>View 1</p></div>
<div x-show="2 === viewSwitcher"><p>View 2</p></div>
<div x-show="3 === viewSwitcher"><p>View 3</p></div>
</div>
</body>
</html>