其他分享
首页 > 其他分享> > 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()还没被全局加载进入
 

标签:forget,no,Did,permission,js,main,useMainStore,加载
来源: https://www.cnblogs.com/zhaoyun4122/p/16412557.html