Skip to content

getPopupContainer,类型错误 #8151

Open
@soluationsign

Description

@soluationsign
  • 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的参数类型

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions