提交 5d723106 编写于 作者: D DeepKolos

规范null的使用, 更换bug演示方式

上级 1d60f000
<template>
<div class="page-cell make-overflow">
<div class="page-cell">
<div class="page-title">Cell Swipe</div>
<mt-cell-swipe
v-for="n in 10"
v-for="n in 15"
:right="rightButtons"
title="swipe me">
</mt-cell-swipe>
......@@ -32,9 +32,3 @@
}
};
</script>
<style>
.make-overflow{
height: 130vh;
}
</style>
......@@ -126,8 +126,7 @@ export default {
return `translate3d(${offset}px, 0, 0)`;
},
setAnimations(on) {
var val = on ? null : '0ms';
setAnimations(val) {
this.wrap.style.transitionDuration = val;
this.rightWrapElm.style.transitionDuration = val;
this.leftWrapElm.style.transitionDuration = val;
......@@ -172,14 +171,14 @@ export default {
this.dragging = true;
this.start.x = evt.pageX;
this.start.y = evt.pageY;
this.direction = null;
this.direction = '';
},
onDrag(evt) {
if (this.opened) {
if (!this.swiping) {
this.swipeMove(0);
this.setAnimations(true);
this.setAnimations('');
}
this.opened = false;
return;
......@@ -194,9 +193,9 @@ export default {
const y = Math.abs(offsetTop);
const x = Math.abs(offsetLeft);
this.setAnimations(false);
this.setAnimations('0ms');
if (this.direction === null) {
if (this.direction === '') {
this.direction = x > y ? 'horizonal' : 'vertical';
}
......@@ -218,8 +217,8 @@ export default {
},
endDrag() {
this.direction = null;
this.setAnimations(true);
this.direction = '';
this.setAnimations('');
if (!this.swiping) return;
this.swipeLeaveTransition(this.offsetLeft > 0 ? -1 : 1);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册