核心代码
function vueTouch(el,binding,type){
//触屏函数
var _this=this;
this.obj=el;
this.binding=binding;
this.touchType=type;
this.vueTouches={
x:0,y:0};//触屏坐标
this.vueMoves=true;
this.vueLeave=true;
this.vueCallBack=typeof(binding.value)=="object"?binding.value.fn:binding.value;
this.obj.addEventListener("touchstart",function(e){
_this.start(e);
},false);
this.obj.addEventListener("touchend",function(e){
_this.end(e);
},false);
this.obj.addEventListener("touchmove",function(e){
_this.move(e);
},false);
};
vueTouch.prototype={
start:function(e){
//监听touchstart事件
this.vueMoves=true;
this.vueLeave=true;
this.longTouch=true