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 11import { noop } from '~/utils'
22
33export 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
66 return { x, y }
77 }
88 else {
9- const { clientX : x , clientY : y } = e
9+ const { clientX : x , clientY : y } = e . targetTouches [ 0 ]
1010 return { x, y }
1111 }
1212}
Original file line number Diff line number Diff line change @@ -17,7 +17,12 @@ export function useSwipeToClose(
1717
1818 const vfmContentEl = ref < HTMLDivElement > ( )
1919 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+ } )
2126
2227 const offset = ref ( 0 )
2328 const isCollapsed = ref < boolean | undefined > ( true )
You can’t perform that action at this time.
0 commit comments