-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
236 lines (207 loc) · 6.82 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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>Vue - Tooltips.js 简单简洁的信息提示框</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no"/>
<link rel="stylesheet" href="https://cdn.bootcss.com/normalize/7.0.0/normalize.min.css">
<link rel="stylesheet" href="https://at.alicdn.com/t/font_vsqt2ljaiv7eewmi.css">
<!-- include tooltips.css -->
<link rel="stylesheet" href="dist/tooltips.css">
<!-- page.css -->
<style type="text/css">
html {
background: #f1f1f1;
margin: 0 20px;
}
body {
background: #fff;
color: #444;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif;
margin: 140px auto 25px;
padding: 20px 20px 10px 20px;
max-width: 700px;
-webkit-font-smoothing: subpixel-antialiased;
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.13);
box-shadow: 0 1px 3px rgba(0,0,0,0.13);
}
a {
color: #0073aa;
}
h1, h2 {
border-bottom: 1px solid #ddd;
clear: both;
color: #666;
font-size: 24px;
padding: 0;
padding-bottom: 7px;
font-weight: 400;
}
h3 {
font-size: 16px;
}
p, li, dd, dt {
padding-bottom: 2px;
font-size: 14px;
line-height: 1.5;
}
code, .code {
font-family: Consolas, Monaco, monospace;
}
ul, ol, dl {
padding: 5px 5px 5px 22px;
}
a img {
border:0
}
abbr {
border: 0;
font-variant: normal;
}
fieldset {
border: 0;
padding: 0;
margin: 0;
}
label {
cursor: pointer;
}
#logo {
margin: 6px 0 14px 0;
padding: 0 0 7px 0;
border-bottom: none;
text-align:center
}
#logo a {
color: #42b983;
font-size: 42px;
font-weight: 400;
line-height: 1.3em;
margin: -130px auto 50px;
padding: 0;
text-decoration: none;
outline: none;
overflow: hidden;
display: block;
}
#logo a small {
font-size: 14px;
color: #444;
}
.ui-icon {
font-size: 24px;
line-height: 24px;
vertical-align: middle;
position: relative;
margin-right: 10px;
top: -1px;
}
.btn {
display: inline-block;
color: #333;
text-decoration: none;
margin-bottom: 15px;
padding: 7px 20px;
border: 1px solid #d9d9d9;
background-color: #FFF;
margin-right: 10px;
border-radius: 3px;
font-size: 14px;
}
.btn.success { background-color: #50bfff; border-color: #50bfff; color: #FFF; }
.btn.warning { background-color: #f7ba2a; border-color: #f7ba2a; color: #FFF; }
.btn.danger { background-color: #ff4949; border-color: #ff4949; color: #FFF; }
</style>
</head>
<body>
<div id="app">
<h1 id="logo">
<a href="https://github.com/webjyh/vue-tooltips">Vue - Tooltips.js <small>Vue 2.x+</small></a>
</h1>
<h3>默认类型</h3>
<div style="margin-bottom: 20px;">
<a href="javascript:;" class="btn default" @click="open('default')">默认</a>
<a href="javascript:;" class="btn success" @click="open('success')">成功</a>
<a href="javascript:;" class="btn warning" @click="open('warning')">警告</a>
<a href="javascript:;" class="btn danger" @click="open('danger')">危险</a>
</div>
<h3>设置带 icon <small style="color: #ff4949;">[图标样式需自己设置]</small></h3>
<div style="margin-bottom: 20px;">
<a href="javascript:;" class="btn success" @click="openIcon('success')">成功</a>
<a href="javascript:;" class="btn warning" @click="openIcon('warning')">警告</a>
<a href="javascript:;" class="btn danger" @click="openIcon('danger')">危险</a>
</div>
<h3>设置关闭时间</h3>
<div style="margin-bottom: 20px;">
<a href="javascript:;" class="btn success" @click="timeout(5000)">5 秒后消失</a>
</div>
<h3>设置关闭时回调</h3>
<div style="margin-bottom: 20px;">
<a href="javascript:;" class="btn success" @click="callback">我会 alert(1); </a>
</div>
<h3>多文字展示 <small style="color: #ff4949;">[手机下预览效果更明显]</small></h3>
<div style="margin-bottom: 20px;">
<a href="javascript:;" class="btn success" @click="text">我是非常多的文字</a>
</div>
<h3>更多调用方法</h3>
<div style="margin-bottom: 20px;">
<a href="javascript:;" class="btn default" @click="open('default')">默认:this.$tooltips(msg, options)</a>
<a href="javascript:;" class="btn success" @click="methods('success')">this.$tooltips.success(msg, options)</a>
<a href="javascript:;" class="btn warning" @click="methods('warning')">this.$tooltips.warning(msg, options)</a>
<a href="javascript:;" class="btn danger" @click="methods('error')">this.$tooltips.error(msg, options)</a>
</div>
<h3>#About</h3>
<div style="margin-bottom: 20px;">
<a href="http://webjyh.com" target="_blank" style="margin-right: 20px;">M.J</a>
<a href="https://github.com/webjyh/vue-tooltips" target="_blank">GitHub</a>
</div>
</div>
<!-- include vue.js -->
<script type="text/javascript" src="https://cdn.bootcss.com/vue/2.3.4/vue.js"></script>
<script type="text/javascript" src="https://cdn.bootcss.com/fastclick/1.0.6/fastclick.min.js"></script>
<!-- include tooltips.js -->
<script type="text/javascript" src="dist/tooltips.min.js"></script>
<script type="text/javascript">
(function() {
FastClick.attach(document.body);
new Vue({
el: '#app',
data: function() {
return {
}
},
methods: {
open: function(type) {
this.$tooltips('我是 tooltips.js 消息提示', {type: type});
},
openIcon: function(type) {
this.$tooltips('<i class="ui-icon iconfont icon-'+ type +'"></i> 图标和图标样式需要自己设置!', {type: type})
},
timeout: function(time) {
this.$tooltips('我 5 秒后自动消失,默认是3秒哦!', time);
},
callback: function() {
this.$tooltips('过会关闭的时候 alert(1);', {
type: 'success',
duration: 3000,
callback: function() {
alert(1);
}
});
},
text: function() {
this.$tooltips('我是非常非常非常多的文字;我是非常非常非常多的文字;我是非常非常非常多的文字;我是非常非常非常多的文字;');
},
methods: function(type) {
this.$tooltips[type]('我是 tooltips.js 消息提示', {type: type});
}
}
});
}());
</script>
</body>
</html>