mixin.js 368 B

1234567891011121314
  1. /* 目前nuxt 版本如果不高于 1.0.0 并不支持vuex的方法,因此获取相对于的东西只能通过this.$store.state来获取
  2. 如果nuxt框架为 1.0.0以上,vuex属性状态这里可以优化
  3. */
  4. import Vue from 'vue'
  5. // import { mapState } from 'vuex'
  6. Vue.mixin({
  7. computed: {
  8. user() {
  9. return this.$store.state.option.user
  10. }
  11. }
  12. })