C/C++教程

getActivePinia was called with no active Pinia. Did you forget to install pinia

本文主要是介绍getActivePinia was called with no active Pinia. Did you forget to install pinia,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
不要在permission.js文件里 
import {useMainStore} from "@/store/main";
后直接
const storeMain = useMainStore()
要在beforeEach 再去执行
不然由于
permission.js加载的时候就会执行useMainStore()
这个时候main.js中的
createPinia()还没被全局加载进入
 
这篇关于getActivePinia was called with no active Pinia. Did you forget to install pinia的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!