vueComponent / ant-design-vue

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

在axios拦截器里使用message、notification等API,无法使用config provider定义的主题 #7768

Open jiangyong1998 opened 2 months ago

jiangyong1998 commented 2 months ago

Version

4.2.3

Environment

"vue": "^3.4.29"

Reproduction link

Steps to reproduce

使用app组件包裹应用,基础用法和全局场景 (pinia 场景)都尝试过

What is expected?

可以正常显示

What is actually happening?

报错:useGlobalStore(...).message?.success is not a function

twosoy commented 2 months ago

遇到同样的问题,不确定是自己的写法有问题,还是框架自身有bug,跪求解决。

jiangyong1998 commented 2 months ago

遇到同样的问题,不确定是自己的写法有问题,还是框架自身有bug,跪求解决。 image image

可以暂时先手动挂载到全局

twosoy commented 2 months ago

我试试,谢谢。

gaokun commented 2 months ago

https://antdv.com/components/message-cn#%E4%B8%BA%E4%BB%80%E4%B9%88-message-%E4%B8%8D%E8%83%BD%E8%8E%B7%E5%8F%96-context%E3%80%81pinia-%E7%9A%84%E5%86%85%E5%AE%B9%E5%92%8C-configprovider-%E7%9A%84-locale-prefixcls-theme-%E7%AD%89%E9%85%8D%E7%BD%AE%EF%BC%9F

文档中有提到

github-actions[bot] commented 5 days 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