-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathexample.html
56 lines (46 loc) · 2.11 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<title></title>
<style type="text/css">
*{margin: 0; padding: 0;}
span{width: 50px;height: 50px;background: #ADADAD;float: left;width: 40%;margin: 5%;word-break: normal;word-wrap: break-word;}
</style>
<script type="text/javascript" src="https://unpkg.com/[email protected]"></script>
<script src="dist/vue-gesture.js"></script>
</head>
<body >
<div id = 'app'>
<vue-gesture :type="'touchstart'" :call="handleComponent.bind(this,'touchstart')" >touchstart</vue-gesture>
<vue-gesture :type="'touchmove'" :call="handleComponent.bind(this,'touchmove')" ><i>touchmove</i></vue-gesture>
<vue-gesture :type="'touchend'" :call="handleComponent.bind(this,'touchend')" >touchend</vue-gesture>
<vue-gesture :type="'tab'" :call="handleComponent.bind(this,'tab')" >tap</vue-gesture>
<vue-gesture :type="'doubletap'" :call="handleComponent.bind(this,'doubletap')">doubleTap</vue-gesture>
<vue-gesture :type="'longTap'" :call="handleComponent.bind(this,'longTap')">longTap</vue-gesture>
<vue-gesture :type="'swipe'" :call="handleComponent.bind(this,'swipe')">swipe</vue-gesture>
<vue-gesture :type="'swipeLeft'" :call="handleComponent.bind(this,'swipeLeft')">swipeLeft</vue-gesture>
<vue-gesture :type="'swipeRight'" :call="handleComponent.bind(this,'swipeRight')">swipeRight</vue-gesture>
<vue-gesture :type="'swipeUp'" :call="handleComponent.bind(this,'swipeUp')">swipeUp</vue-gesture>
<vue-gesture :type="'swipeDown'" :call="handleComponent.bind(this,'swipeDown')">swipeDown</vue-gesture>
<vue-gesture :type="'click'" :call="handleComponent.bind(this,'click')">click</vue-gesture>
</div>
<script type="text/javascript">
new Vue({
el: '#app',
data: {
message: 'Hello Vue.js!'
},
methods: {
handleComponent: function(str,e){
console.log(e);
var html = e.srcElement.innerHTML;
e.srcElement.innerHTML=html+" "+str;
console.log(str);
}
}
})
</script>
</body>
</html>