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无法关闭 #7329

Closed
1 task
yizhigee opened this issue Feb 2, 2024 · 3 comments
Closed
1 task

Modal.confirm无法关闭 #7329

yizhigee opened this issue Feb 2, 2024 · 3 comments

Comments

@yizhigee
Copy link

yizhigee commented Feb 2, 2024

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

Version

3.2.0

Environment

vue: 3.2.33

Steps to reproduce

Modal.confirm无法关闭

What is expected?

希望可以正常关闭

What is actually happening?

Modal.confirm无法关闭,希望可以正常关闭

@wsxe9988
Copy link

wsxe9988 commented Feb 2, 2024

#7252 等待唐老师合并

@yizhigee
Copy link
Author

yizhigee commented Feb 2, 2024

已经解决了:版本如下
"ant-design-vue": "^3.2.20",
"vue": "^3.2.25",

@selicens selicens closed this as completed Feb 2, 2024
@linpengteng
Copy link

You can use

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)
}

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
@wsxe9988 @linpengteng @selicens @yizhigee and others