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
+5
View File
@@ -23,6 +23,9 @@ export function useTouch() {
const offsetY = ref(0);
const direction = ref('');
const isVertical = () => direction.value === 'vertical';
const isHorizontal = () => direction.value === 'horizontal';
const reset = () => {
deltaX.value = 0;
deltaY.value = 0;
@@ -60,5 +63,7 @@ export function useTouch() {
offsetX,
offsetY,
direction,
isVertical,
isHorizontal,
};
}