"getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
使用pinia时候遇到的问题
使用pinia store必须在 组件的 setup 里面
vue-router路由文件需要在路由钩子里面用
报错之前代码--
把 const userStore = useUserStore()
放在了
router.beforeEach((to, from, next)
钩子函数的
外面了
本想把生活活成一首诗, 时而优雅 , 时而豪放 , 结果活成了一首歌 , 时而不靠谱 , 时而不着调