ktsn / vuex-class

Binding helpers for Vuex and vue-class-component
MIT License
1.73k stars 86 forks source link

@State in Mixin class #38

Closed ivolkoff closed 6 years ago

ivolkoff commented 6 years ago

I have Mixin class. When i use the decorator, console.log show undefined, but when I use the function, i has right result.

import {Component, Vue, Watch} from "vue-property-decorator";
import {Mutation, State, Action} from "vuex-class";

@Component
export default class MixinStatisticComponent extends Vue {
  //@State(state => state.statistic.table) table;

  get table(){
    return this.$store.state.statistic.table;
  }

  mounted(){
    console.log(this.table);
  }
}
ktsn commented 6 years ago

Could you provide a self-contained reproduction?

ivolkoff commented 6 years ago

when i add <script lang="ts"> problem away