fix: 🐛 修复 DropMenu 设置 Modal 无效的问题 (#1125)

 Closes: #1121
This commit is contained in:
不如摸鱼去 2025-06-22 13:04:38 +08:00 committed by GitHub
parent ff99b22a69
commit eddbd5d22e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View File

@ -78,7 +78,6 @@ const showWrapper = ref<boolean>(false)
const showPop = ref<boolean>(false) const showPop = ref<boolean>(false)
const position = ref<PopupType>() const position = ref<PopupType>()
const zIndex = ref<number>(12) const zIndex = ref<number>(12)
const modal = ref<boolean>(true)
const duration = ref<number>(0) const duration = ref<number>(0)
const { parent: dropMenu } = useParent(DROP_MENU_KEY) const { parent: dropMenu } = useParent(DROP_MENU_KEY)
@ -186,7 +185,6 @@ function handleOpen() {
showWrapper.value = true showWrapper.value = true
showPop.value = true showPop.value = true
if (dropMenu) { if (dropMenu) {
modal.value = Boolean(dropMenu.props.modal)
duration.value = Number(dropMenu.props.duration) duration.value = Number(dropMenu.props.duration)
position.value = dropMenu.props.direction === 'down' ? 'top' : 'bottom' position.value = dropMenu.props.direction === 'down' ? 'top' : 'bottom'
} }

View File

@ -1,6 +1,14 @@
<template> <template>
<view :style="customStyle" :class="`wd-drop-menu ${customClass}`" @click.stop.prevent="noop" :id="dropMenuId"> <view :style="customStyle" :class="`wd-drop-menu ${customClass}`" @click.stop.prevent="noop" :id="dropMenuId">
<wd-overlay :show="overlayVisible" :duration="duration" :z-index="12" :custom-style="modalStyle" @click="handleClickOverlay" @touchmove="noop" /> <wd-overlay
:show="overlayVisible"
:duration="duration"
:z-index="12"
:custom-style="modalStyle"
@click="handleClickOverlay"
@touchmove="noop"
v-if="modal"
/>
<!-- #ifdef MP-DINGTALK --> <!-- #ifdef MP-DINGTALK -->
<view :id="dropMenuId"> <view :id="dropMenuId">