mutations.js 241 B

123456789101112
  1. import { INCREMENT, DECREMENT } from './mutation-types'
  2. export default {
  3. [INCREMENT] (state) {
  4. state.count++
  5. state.history.push('increment')
  6. },
  7. [DECREMENT] (state) {
  8. state.count--
  9. state.history.push('decrement')
  10. }
  11. }