【发布时间】:2020-12-07 06:01:23
【问题描述】:
我已在我的应用程序中安装了 @nuxtjs/toast 并正常工作。
我想在发送操作后显示祝酒词。
如何在 vuex 商店的模块中的操作中访问 $toast?
PS:我正在使用带有 typescript 的 Nuxt,从 intellisense 看来我只能访问 $router 和 $axios。
export const actions: ActionTree<ProfileState, RootState> = {
async updateProfile({ }, user) {
console.log(user);
const newUserObj = await this.$axios.post("/me/update", user).then(res => res.data.data);
console.log(newUserObj);
// this.$toast.info("Hello");
// commit('LOAD_NEW_USER', newUserObj);
},
}
【问题讨论】:
标签: typescript vuex nuxt.js toast