<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="favicon.ico" mce_href="favicon.ico" rel="bookmark" type="image/x-icon" />
<link href="favicon.ico" mce_href="favicon.ico" rel="icon" type="image/x-icon" />
<link href="favicon.ico" mce_href="favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title></title>
<!--引入vue-->
<script src="https://cdn.bootcss.com/vue/2.5.17-beta.0/vue.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<style type="text/css">
#app{
height: 35rem;
background-color: red;
color: #fff;
text-align: center;
line-height: 5rem;
}
</style>
<body>
<!--mvvm-->
<!--view -->
<script type="text/javascript">
if (!localStorage.user_id) {
location.href = "../../new_file.html";
}
</script>
<div id="app" class="box" v-tap="vuetouch"
v-longtap="{fn:vuetouch,name:'长按'}"
v-swipeleft="{fn:vuetouch,name:'左滑'}"
v-swiperight="{fn:vuetouch,name:'右滑'}"
v-swipeup="{fn:vuetouch,name:'上滑'}"
v-swipedown="{fn:vuetouch,name:'下滑'}"
>
{{ name }}
</div>
<script src="touch.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
new Vue({
el:"#app",
data:{
name:"开始"
},
methods:{
vuetouch:function(s,e){
this.name=s.name;
}
}
});
</script>
</body>
</html>