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 is not function #781

Open
5 tasks done
15831434134 opened this issue Jul 11, 2024 · 1 comment
Open
5 tasks done

Modal.confirm is not function #781

15831434134 opened this issue Jul 11, 2024 · 1 comment

Comments

@15831434134
Copy link

Describe the bug

代码打包后,报错 xx.confirm is not function

  1. vite 配置:
    import Components from 'unplugin-vue-components/vite'
    import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers'
    plugins: [
    ...
    Components({
    resolvers: [AntDesignVueResolver({ resolveIcons: true })],
    }),

    ],

  2. vue文件配置
    import {Modal} from 'ant-design-vue'

在本地运行没问题,打包部署后 报错 xx.confirm is not function
是什么原因 ?

Reproduction

"ant-design-vue": "^3.2.15", "unplugin-vue-components": "^0.22.9",

System Info

浏览器

Used Package Manager

yarn

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@15831434134
Copy link
Author

当换成
import Modal from 'ant-design-vue/lib/modal'
这种引用方式打包后就正确识别Modal.confirm

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

1 participant