Vickies 最近的时间轴更新
Vickies

Vickies

V2EX 第 414606 号会员,加入于 2019-05-22 14:14:09 +08:00
google cloud 搭的 ssr 挂了吗?
每个月都会出现的那种主题  •  Vickies  •  2019-09-16 23:49:55 PM  •  最后回复来自 allenlee7c9
2
有没有发现 Airpods 连 Mac pro 的时候左耳机声音小一点?
MacBook Pro  •  Vickies  •  2020-04-15 11:38:05 AM  •  最后回复来自 firemiles
9
Vickies 最近回复了
js 代码如下:
function vueTouch(el, binding, type, vnode){
this.obj = el;
this.binding = binding;
this.touchType = type;
this.vueTouches = { x: 0, y: 0 };

this.isMoving = false;
this.isUseTapTouch = false;
this.isUseLongTouch = false;

this.vueCallBack = binding.value;

this.obj.addEventListener("touchstart", (e) => {
this.start(e);
}, false);
this.obj.addEventListener("touchend", (e) => {
this.end(e);
}, false);
this.obj.addEventListener("touchmove", (e) => {
this.move(e);
}, false);
}
vueTouch.prototype = {
start: function(e) {
this.isMoving = false;
this.isUseTapTouch = false;
this.isUseLongTouch = false;
this.vueTouches = { x: e.changedTouches[0].pageX, y: e.changedTouches[0].pageY };
},
end: function(e){
const disX = e.changedTouches[0].pageX - this.vueTouches.x;
const disY = e.changedTouches[0].pageY - this.vueTouches.y;

if(Math.abs(disX) > 10 || Math.abs(disY) > 100){
this.touchType === "swipe" && this.vueCallBack(e);

if(Math.abs(disX) > Math.abs(disY)) {
if(disX > 10) {
this.touchType === "swiperight" && this.vueCallBack(e);
}
if(disX < -10) {
this.touchType === "swipeleft" && this.vueCallBack(e);
}
} else {
if(disY > 10) {
this.touchType === "swipedown" && this.vueCallBack(e);
}
if(disY < -10) {
this.touchType === "swipeup" && this.vueCallBack(e);
}
}
}
},
move: function(){
this.isMoving = true;
},
};
export const swipedown = {
mounted(el, binding, vnode) {
new vueTouch(el, binding, "swipedown", vnode);
},
unmounted(el,binding,vnode) {

}
}
export const swipeup = {
mounted(el, binding, vnode) {
new vueTouch(el, binding, "swipeup", vnode);
},
unmounted(el,binding,vnode) {

}
}
@Ashore 准备换了。。。。
2019-08-02 15:04:36 +08:00
回复了 fakeMaster 创建的主题 程序员 两条光纤组成两个局域网如何互通
搞个三层路由,开启 ip routing 就可以了啊
2019-05-23 00:29:17 +08:00
回复了 mason961125 创建的主题 天黑以后 20190522 午夜俱乐部
刚下班,广州还下雨,有点悲伤。。
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2851 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 27ms · UTC 09:04 · PVG 17:04 · LAX 01:04 · JFK 04:04
Developed with CodeLauncher
♥ Do have faith in what you're doing.