chore(touch): add isVertical/isHorizontal

This commit is contained in:
chenjiahan
2020-09-14 20:56:28 +08:00
parent 46e158fa01
commit c8d573cbe7
7 changed files with 18 additions and 12 deletions
+2 -2
View File
@@ -44,7 +44,6 @@ export default createComponent({
});
const touch = useTouch();
const { deltaX, direction } = touch;
const getWidthByRef = (ref) => (ref.value ? useRect(ref).width : 0);
@@ -107,9 +106,10 @@ export default createComponent({
return;
}
const { deltaX } = touch;
touch.move(event);
if (direction.value === 'horizontal') {
if (touch.isHorizontal()) {
lockClick = true;
state.dragging = true;