-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
43 lines (38 loc) · 1.03 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
37
38
39
40
41
42
43
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
<title>balckTip</title>
<style>
</style>
</head>
<body>
<h1>cbui-toast</h1>
<button id="loading">loading</button>
<button id="success">success</button>
<button id="info">info</button>
<button id="error">error</button>
<script>
// 事件操作
function $(str) {
return document.querySelector(str);
}
function bind(ele, fn) {
ele.addEventListener('click', fn, false);
}
bind($('#loading'), function () {
Toast.loading();
});
bind($('#success'), function () {
Toast.success();
});
bind($('#info'), function () {
Toast.info();
});
bind($('#error'), function () {
Toast.error();
});
</script>
</body>
</html>