2018-09-06

import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
const Minus = 'Minus';
export default new Vuex.Store({
state: {
show: 1
},
mutations: {
increment(state) {
state.show++
},
Minus {
state.show--
}
}
})

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 安装 npm npm install vuex --save 在一个模块化的打包系统中,您必须显式地通过Vue.u...
    萧玄辞阅读 2,964评论 0 7
  • vue笔记 一.vue实例 vue的生命周期 beforeCreate(创建前), created(创建后), b...
    秋殇1002阅读 1,076评论 0 1
  • Vuex是什么? Vuex 是一个专为 Vue.js应用程序开发的状态管理模式。它采用集中式存储管理应用的所有组件...
    萧玄辞阅读 3,153评论 0 6
  • mutations: { increment(state) { state.show++ }, ...
    过往的乌云阅读 221评论 0 0
  • mutations: {increment(state) {state.show++},Minus {state....
    过往的乌云阅读 168评论 0 0