Getters

All ES6 getter functions of the class are converted into vuex getters

For example, the following code -






 
 
 


import { Module, VuexModule } from 'vuex-module-decorators'

@Module
export default class Vehicle extends VuexModule {
  wheels = 2
  get axles() {
    return wheels / 2
  }
}

is equivalent of this -






 



export default {
  state: {
    wheels: 2
  },
  getters: {
    axles: (state) => state.wheels / 2
  }
}