Skip to content

getPopupContainer,类型错误 #8151

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

Open
1 task
soluationsign opened this issue May 6, 2025 · 0 comments
Open
1 task

getPopupContainer,类型错误 #8151

soluationsign opened this issue May 6, 2025 · 0 comments

Comments

@soluationsign
Copy link

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

Version

4.2.6

Environment

"vue": "^3.5.13","ant-design-vue": "^4.2.6",

Reproduction link

Edit on CodeSandbox

Steps to reproduce

a-config-provider配置getPopupContainer的类型推断存在问题

What is expected?

可以正确定义getPopupContainer属性的参数类型

What is actually happening?

<script setup lang="ts">
import zhCn from "ant-design-vue/es/locale/zh_CN";

const getPopupContainer: any = (_: any, dialogContext: any) => {
if (dialogContext) {
return dialogContext.getDialogWrap();
} else {
return document.body;
}
};
</script>

<template>
<a-config-provider :getPopupContainer="getPopupContainer" :locale="zhCn">
<router-view />
</a-config-provider>
</template>

getPopupContainer属性的类型推断是(property) getPopupContainer?: ((triggerNode?: HTMLElement) => HTMLElement) | undefined,ant-design-vue已更新至最新版本4.2.6,但根据官网的https://www.antdv.com/components/config-provider-cn配置应该还存在dialogContext参数,所以我定义了any,希望可以正确推断getPopupContainer的参数类型

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