-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
68 lines (58 loc) · 1.49 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>vue-smart-tap</title>
<meta name="format-detection" content="telephone=no">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
</head>
<style>
body, html {
}
#app{
}
.btn{
font-size: 18px;
padding: 5px;
color: #fff;
background: cadetblue;
}
</style>
<body>
<div id="app">
<div v-tap="tap" class="btn">tap</div>
<div v-tap:long="longTap" class="btn">long tap</div>
tapCount:{{tapCount}}<br/>
longTapCount:{{longTapCount}}
</div>
<script src="node_modules/vue/dist/vue.js"></script>
<script src="dist/vue-smart-tap.js"></script>
<script>
Vue.use(VueSmartTap,{time:300,longTime:1000,count:3});
new Vue({
el: '#app', data: {
tapCount:0,longTapCount:0
},
mounted: function () {
},
methods:{
tap:function(e){
// console.log(this)
this.tapCount+=1
console.log('taped',e);
},
longTap:function(e){
this.longTapCount+=1
console.log('longtaped',e);
}
},
components: {
VueSmartTap: VueSmartTap
}
})
</script>
</body>
</html>