我有一个像这样的 vuex 商店:
const state = {
status: '',
};
const getters = {
//...
};
const actions = {
// ...
};
const mutations = {
// ...
};
export default {
namespaced: true,
state,
getters,
actions,
mutations,
}
现在我想访问app.config.globalProperties.$notify
在 Vue.js2 中,我使用了类似的东西Vue.prototype.$notify
,但这不再起作用了。
$notify
也是这样提供的:
app.use(routes)
.provide('notify', app.config.globalProperties.$notify)
.mount('#app')
不幸的是,我还没有在文档中找到任何关于此的信息。
所以我的问题是:我如何在这家商店中注入$notify
或访问app.config.globalProperties
?