vuex有两种存储方式 commit 和dispatch

commit属于同步操作

存储

this.$store.commit('存的名字',name)

取值

this.$store.state.存的名字

dispatch属于异步操作

存储

this.$store.dispatch('存的名字',name)

取值

this.$store.getters.存的名字

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-01
相关资源
相似解决方案