Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal.confirm() 点击取消无法关闭 #7375

Closed
1 task
kortin99 opened this issue Feb 23, 2024 · 5 comments
Closed
1 task

Modal.confirm() 点击取消无法关闭 #7375

kortin99 opened this issue Feb 23, 2024 · 5 comments

Comments

@kortin99
Copy link

kortin99 commented Feb 23, 2024

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.2.20

Environment

OS: MacOS 14.2.1
Browser: Chrome 122.0.6261.57
Vue: 3.4.14

Reproduction link

Edit on CodeSandbox

Steps to reproduce

直接使用 3.2.20 文档上 Modal.confirm 的 codesandbox 可复现

What is expected?

点击取消按钮可以正常关闭模态框

What is actually happening?

Modal.confirm 点击取消按钮无反应

@kortin99
Copy link
Author

排查依赖版本后发现使用 vue 3.4 会出现此问题,vue 降级至 3.3.x 功能正常

@aibayanyu20
Copy link
Member

duplicate #7257
pr #7252

@linpengteng
Copy link

Maybe: You can ...

import { createVNode, render } from 'vue'
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'
import ConfirmDialog from 'ant-design-vue/es/modal/ConfirmDialog'

const showConfirm = () => {
  const element = document.createDocumentFragment() as any
  const dialog = createVNode(ConfirmDialog, {
    type: 'confirm',
    visible: true,
    prefixCls: 'ant-modal',
    rootPrefixCls: 'ant',
    contentPrefixCls: 'ant-modal-confirm',
    icon: createVNode(ExclamationCircleOutlined),
    title: '是否确认删除该菜单?',
    content: '删除菜单会导致相关页面丢失,请慎重考虑!',
    okText: '删除',
    okType: 'danger',
    onCancel: () => { dialog.component!.props.visible = false },
    onOk: () => {
       // do some thing
       dialog.component!.props.visible = false
    }
  })

  render(dialog, element)
}

@Secret1007
Copy link

排查依赖版本后发现使用 vue 3.4 会出现此问题,vue 降级至 3.3.x 功能正常

我就是3.3.4。。

@doraemonxxx
Copy link

doraemonxxx commented Apr 15, 2024

i downgrade but it is still the same. this is not because of the vue 3.3.4 version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants