mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(ImagePreview): swipeItem may be undefined (#12818)
This commit is contained in:
parent
9dea0e9572
commit
01183e1208
@ -255,6 +255,9 @@ export default defineComponent({
|
||||
|
||||
const checkClose = (event: TouchEvent) => {
|
||||
const swipeItemEl: HTMLElement = swipeItem.value?.$el;
|
||||
|
||||
if (!swipeItemEl) return;
|
||||
|
||||
const imageEl = swipeItemEl.firstElementChild;
|
||||
const isClickOverlay = event.target === swipeItemEl;
|
||||
const isClickImage = imageEl?.contains(event.target as HTMLElement);
|
||||
|
Loading…
x
Reference in New Issue
Block a user