vueComponent / ant-design-vue

🌈 An enterprise-class UI components based on Ant Design and Vue. 🐜
https://antdv.com/
Other
20.34k stars 3.8k forks source link

definition conflict while using both element-ui and ant-design-vue in typescript in vue-cli-3.8.4 #899

Closed weixiao-huang closed 3 years ago

weixiao-huang commented 5 years ago

Version

1.3.10

Environment

MacOS 10.14.5, chrome, vue-cli-3.8.4 and use it to create the minimal reproduction

Reproduction link

https://github.com/weixiao-huang/vue-antd-ui-demo

Steps to reproduce

yarn
yarn serve

What is expected?

App running at:
- Local:   http://localhost:8080/
- Network: unavailable

Note that the development build is not optimized.
To create a production build, run yarn build.

What is actually happening?

App running at:
- Local:   http://localhost:8080/
- Network: unavailable

Note that the development build is not optimized.
To create a production build, run yarn build.

ERROR in /Users/weixiaohuang/Programs/Web/vue-antd-ui-demo/node_modules/ant-design-vue/types/message.d.ts
81:5 Subsequent property declarations must have the same type.  Property '$message' must be of type 'ElMessage', but here has type 'Message'.
79 | declare module 'vue/types/vue' {
80 |   interface Vue {
> 81 |     $message: Message;
|     ^
82 |   }
83 | }
84 |
ERROR in /Users/weixiaohuang/Programs/Web/vue-antd-ui-demo/node_modules/ant-design-vue/types/modal.d.ts
297:5 Subsequent property declarations must have the same type.  Property '$confirm' must be of type 'ElMessageBoxShortcutMethod', but here has type '(modalOptios: ModalOptions) => ModalConfirm'.
295 |     $error: (modalOptios: ModalOptions) => ModalConfirm;
296 |     $warning: (modalOptios: ModalOptions) => ModalConfirm;
> 297 |     $confirm: (modalOptios: ModalOptions) => ModalConfirm;
|     ^
298 |   }
299 | }
300 |
Version: typescript 3.5.2
Time: 3113ms

This may be the conflict of the same type augmentation from element-ui and ant-design-vue, but I don't know how to resolve this problem

weixiao-huang commented 5 years ago

Are there some updates to solve this problem?

yingyuk commented 5 years ago

Duplicate of #https://github.com/youzan/vant/issues/3324

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.