vueComponent / ant-design-vue

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

使用pinia封装message组件,不能正常使用 #7870

Open loongzhu opened 2 weeks ago

loongzhu commented 2 weeks ago

Version

4.2.5

Environment

Windows 11 专业工作站版 22631.4169, Chrome 129.0.6668.90,Vue 3.5.11

Reproduction link

https://stackblitz.com/edit/vitejs-vite-zzcl2j?file=README.md

Steps to reproduce

点击 click 按钮

What is expected?

报错 globalStore.message.success is not a function image

What is actually happening?

正确弹出 message 组件

ZhangMingZhao1 commented 1 week ago

+1 同遇到问题

zcf0508 commented 1 week ago

It seems like a break change from https://github.com/vuejs/core/pull/11502 .

The inject get context from the current instance prototype before, and then now get context from currentApp first .

For now, you can downgrade to Vue version 3.4.36.


https://github.com/vuejs/core/commit/905c9f16e112fa1c39976b7e4b51ecc3d6bcdeab#diff-266ec72d6fefac7102deb68982adb0f29e43cf3491e1cd1968a14d3dad47464cR15

https://github.com/vuejs/pinia/commit/014869be796b6a96afee7b2d9cbfe5073c943292

zcf0508 commented 1 week ago

@loongzhu

可以看下我的这个方案

stackblitz