
简介
该用户还未填写简介
擅长的技术栈
未填写擅长的技术栈
可提供的服务
暂无可提供的服务
使用pinia管理数据,在模块中引入另一个模块时报错:getActivePinia was called with no active Pinia. Did you forget to insta
当我需要另一个模块数据,于是进行了模块导入,出现了报错。在main.js文件中创建并注册pinia。第一种方法: 可以在模块内全局使用。第二种方法: 只能在模块内局部使用。
报错:[vuex] mapActions: mapper parameter must be either an Array or an Object
自己的理解是,methods里放的是,调用方法-->获取后端数据的地方,所以放Actions,和Mutation;Actions通过异步获取数据,在将获取的数据(通过commit方法调用Mutation的方法,)传给Mutation, Mtation将数据赋值给state。原因是:将mapActions('getNowlist')写在了computed里;应该写在methods里。
到底了







