File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
packages/vue-final-modal/src Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { noop } from '~/utils'
2
2
3
3
export const getPosition = ( e : TouchEvent | MouseEvent ) => {
4
- if ( e instanceof TouchEvent ) {
5
- const { clientX : x , clientY : y } = e . targetTouches [ 0 ]
4
+ if ( e instanceof MouseEvent ) {
5
+ const { clientX : x , clientY : y } = e
6
6
return { x, y }
7
7
}
8
8
else {
9
- const { clientX : x , clientY : y } = e
9
+ const { clientX : x , clientY : y } = e . targetTouches [ 0 ]
10
10
return { x, y }
11
11
}
12
12
}
Original file line number Diff line number Diff line change @@ -17,7 +17,12 @@ export function useSwipeToClose(
17
17
18
18
const vfmContentEl = ref < HTMLDivElement > ( )
19
19
const swipeBannerEl = ref < HTMLDivElement > ( )
20
- const swipeEl = computed ( ( ) => ( props . showSwipeBanner ? swipeBannerEl . value : vfmContentEl . value ) )
20
+ const swipeEl = computed ( ( ) => {
21
+ if ( props . swipeToClose === undefined || props . swipeToClose === 'none' )
22
+ return undefined
23
+ else
24
+ return ( props . showSwipeBanner ? swipeBannerEl . value : vfmContentEl . value )
25
+ } )
21
26
22
27
const offset = ref ( 0 )
23
28
const isCollapsed = ref < boolean | undefined > ( true )
You can’t perform that action at this time.
0 commit comments