-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathexample.html
85 lines (85 loc) · 2.44 KB
/
example.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Example</title>
<!-- <link rel="stylesheet" href="../dist/pager.min.css"> -->
<!-- <link rel="stylesheet" href="../dist/tiny-wheels.min.css"> -->
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
.container {
max-width: 800px;
margin: 30px auto;
border-radius: 4px;
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.3);
padding: 16px;
}
.container h2 {
margin: 20px 0;
}
</style>
</head>
<body>
<div class="container">
<h2>Tabs 选项卡</h2>
<div class="tabs" data-tab-active="2" data-tab-disabled="3">
<div data-tab-name="选项卡1" data-tab-key="1">内容1</div>
<div data-tab-name="选项卡2" data-tab-key="2">内容2</div>
<div data-tab-name="选项卡3" data-tab-key="3">内容3</div>
<div data-tab-name="选项卡4" data-tab-key="4">内容4</div>
</div>
</div>
<div class="container">
<h2>Collapse 折叠面板</h2>
<div class="collapse" data-collapse-active="2">
<div data-collapse-name="折叠面板1" data-collapse-key="1">
折叠内容
</div>
<div data-collapse-name="折叠面板2" data-collapse-key="2">
折叠内容
</div>
<div data-collapse-name="折叠面板3" data-collapse-key="3">
折叠内容
</div>
<div data-collapse-name="折叠面板4" data-collapse-key="4">
折叠内容
</div>
</div>
</div>
<div class="container">
<h2>Pager 分页</h2>
<div class="pager"></div>
</div>
<script src="./dist/index.js"></script>
<script>
new TinyWheels.Tabs({
element: document.querySelector('.tabs'),
animated: true,
callback: ($tab, key) => {
console.log($tab, key)
}
})
new TinyWheels.Collapse({
element: document.querySelector('.collapse'),
accordion: false,
callback: ($item, key, keys) => {
console.log($item, key, keys)
}
})
new TinyWheels.Pager({
element: document.querySelector('.pager'),
total: 200,
size: 20,
current: 1,
callback: number => {
console.log(number)
}
})
</script>
</body>
</html>