vueComponent / ant-design-vue

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

【Card】子组件异步emit父组件Card的loading时不生效 #7955

Open liruixiang321 opened 6 days ago

liruixiang321 commented 6 days ago

Version

4.2.6

Environment

"ant-design-vue": "^3.2.5", "vue": "^3.2.36"

Reproduction link

Edit on CodeSandbox

Steps to reproduce

点击按钮

What is expected?

2秒后loading消失

What is actually happening?

2秒后loading未消失

liruixiang321 commented 6 days ago

感觉是由于出现loading时内部使用将子组件卸载了,就无法再复原了

umrsang commented 6 days ago

loading时子组件被卸载了

YiMo1 commented 6 days ago

子组件被卸载了,所以emit直接return了。

export function emit(
  instance: ComponentInternalInstance,
  event: string,
  ...rawArgs: any[]
): ComponentPublicInstance | null | undefined {
  if (instance.isUnmounted) return