1安装:
vue ui
或cnpm install vuex


2/使用
import vuex from 'vuex'

vue.use(vuex)

var store = new Vuex.store({

})


var app = new Vue({
 store:store
})

 

3/安装vue插件,vue.js devtools,插件github地址:https://github.com/vuejs/vue-devtools
进入网上谷歌应用店
搜索vue
安装
重启浏览器


4使用

1、初始化state
2、设置更改state方法,将方法放进mutation里
3、触发state更改的方法,store.commit这个方法去触发mutation里的方法

相关文章:

  • 2021-05-21
  • 2021-07-28
  • 2021-11-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-08
  • 2021-11-04
  • 2022-12-23
  • 2021-10-21
相关资源
相似解决方案