We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
4.2.6
vue 3.5.12
app.vue
<template> app <br /> <a-config-provider :locale="zhCN"> <a-app> <router-view /> </a-app> </a-config-provider> </template> <script setup> import zhCN from "ant-design-vue/es/locale/zh_CN"; </script>
index.vue
<template> index <br /> <a-button @click="addd">点我看提示</a-button> </template> <script setup> import { useGlobalStore } from "./pinia"; const global = useGlobalStore(); console.log(global); const addd = () => { console.log(global.message); console.log(global.message.info("infoa")); }; </script>
pinia
import { App } from "ant-design-vue"; import { defineStore } from "pinia"; import { ref } from "vue"; export const useGlobalStore = defineStore("global", () => { const message = ref(); const notification = ref(); const modal = ref(); (() => { const staticFunction = App.useApp(); message.value = staticFunction.message; modal.value = staticFunction.modal; notification.value = staticFunction.notification; })(); return { message, notification, modal }; });
可以弹出 message 提示
global.message.info is not a function
14 | 15 | const addd = () => { 16 | console.log(global.message); > 17 | console.log(global.message.info("infoa")); | ^ 18 | }; 19 | </script> 20 |
The text was updated successfully, but these errors were encountered:
I have the same issue
Sorry, something went wrong.
+1
@puzzle9 解决了吗
没有 我换框架了
No branches or pull requests
Version
4.2.6
Environment
vue 3.5.12
Reproduction link
Steps to reproduce
app.vue
index.vue
pinia
What is expected?
可以弹出 message 提示
What is actually happening?
global.message.info is not a function
index.vue
The text was updated successfully, but these errors were encountered: