当前位置: 首页 > news >正文

wordpress文章编辑插件关键词优化师

wordpress文章编辑插件,关键词优化师,软件编程学什么专业,网站开发工程师的职责前言: 最近打算用vue 写个音乐播放器,在搞 vuex 的时候遇到一个很神奇报错;vuex 姿势练了千百次了,刚开始的时候我一直以为是代码问题,反复检查了带了,依旧报错。 Error in mounted hook: "TypeError:…
前言:

        最近打算用vue 写个音乐播放器,在搞 vuex 的时候遇到一个很神奇报错;vuex 姿势练了千百次了,刚开始的时候我一直以为是代码问题,反复检查了带了,依旧报错。 Error in mounted hook: "TypeError: Cannot read properties of undefined (reading 'getters')"

 

 除了 mapGetters 中的 方法 都能把数据都正确,连 mapMutations 中的方法都是对的。

按理说 mapMutations 可以,mapGetters 也应该可以才对!

<script>
import { mapGetters, mapMutations } from "vuex";
export default {data() {return {};},computed: {...mapGetters({userInfo: "userInfo",}),userInfo1() {return this.$stroe.state.userInfo;},},mounted() {console.log("this.$stroe:", this.$stroe);console.log("this.$stroe.mapGetters:", this.$stroe.mapGetters);console.log("this.$stroe.getters:", this.$stroe.getters);console.log("this.$stroe.state.userInfo:", this.$stroe.state.userInfo);console.log("this.userInfo1:", this.userInfo1);console.log("this.saveToken:", this.saveToken);console.log("this.userInfo:", this.userInfo);},methods: {...mapMutations({saveToken: "saveToken",}),},
};
</script>输出
store: {…}
this.$stroe: Store {_committing: false, _actions: {…}, _actionSubscribers: Array(0), _mutations: {…}, _wrappedGetters: {…}, …}commit: ƒ boundCommit(type, payload, options)dispatch: ƒ boundDispatch(type, payload)getters: {}strict: false_actionSubscribers: []_actions: {loadStorage: Array(1), cleanStorage: Array(1)}_committing: false_devtools: undefined_makeLocalGettersCache: {}_modules: ModuleCollection {root: Module}_modulesNamespaceMap: {}_mutations: {saveToken: Array(1), updateToken: Array(1), saveUserinfo: Array(1), updateUserInfo: Array(1)}_scope: EffectScope {detached: true, active: true, effects: Array(2), cleanups: Array(0), parent: undefined}_state: {__ob__: Observer}_subscribers: []_wrappedGetters: {userInfo: ƒ, token: ƒ}state: (…)[[Prototype]]: Objectthis.$stroe.mapGetters: undefined
this.$stroe.getters: {}
this.$stroe.state.userInfo: {…}
this.userInfo1: {…}
this.saveToken: ƒ mappedMutation() {var args = [],len = arguments.length;while (len--) args[len] = arguments[len];// Get the commit method from storevar commit = this.$store.commi…

       

解决:

        各种姿势都试了,这次不知道啥情况。代码也检查了;项目重启了, 电脑也重启了。 磨了很长时间 最后试了下 换了个 vuex 版本就然可以了 ! 最后才发现 原来是 引用的 vuex 4.1.0, 版本回退到 3.6.2 就可以了 ,给大家填个坑

http://www.zhongyajixie.com/news/27528.html

相关文章:

  • 搭建网站的价格深圳网络推广公司哪家好
  • 团购网站 方案优化外包哪里好
  • 做网站asp网络广告类型
  • 优秀企业网站设计制作大专网络营销专业好不好
  • 网站里面的按钮链接怎么做怎么自己创建网页
  • 佛山网站建设在哪找厦门关键词排名优化
  • 佛山专业的做网站淘宝网店运营
  • 建行app官方下载seo实战培训视频
  • 上海品划做网站seo黑帽有哪些技术
  • 石家庄效果图设计福州百度seo排名
  • 网站建设公司违法今日新闻头条最新消息
  • 织梦网站怎样做防护最好最全的搜索引擎
  • 论文引用网站数据 如何做注释清远头条新闻
  • 公司网站建设找谁万能搜索引擎网站
  • 网站开发技术实验教程html期末大作业个人网站制作
  • 一站式营销推广平台怎样做网络推广
  • c2c网站建设策划书空间刷赞网站推广
  • 西安网站开发公司贺州seo
  • 专业网站建设费用包括优化大师软件下载
  • 口碑好的品牌网站建设搜索引擎优化时营销关键词
  • 大气医院网站源码域名查询备案
  • 制作个人网站论文百度灰色词排名代发
  • 如何企业网站的软文人工智能培训课程
  • .net网站开发程序员河南网站优化公司
  • 在互联网公司做网站线上如何推广自己的产品
  • 做网站muse好还是DW好用网络广告营销案例
  • 建设部网站村镇建设百度上怎么打广告宣传
  • 订阅号如何做微网站永久免费的电销外呼系统
  • 推荐网站建设服务商深圳网站公司排名
  • 织梦网站优化怎么做长春做网络优化的公司