53ab445309c7dfdd774bc88c71e81217ece451a7.svn-base 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // import Vue from 'vue'
  2. import { mapState } from "vuex";
  3. // const mixinsComputed = Vue.config.optionMergeStrategies.computed
  4. // const mixinsMethods = Vue.config.optionMergeStrategies.methods
  5. const mixin = {
  6. computed: {
  7. ...mapState({
  8. layoutMode: state => state.app.layout,
  9. navTheme: state => state.app.theme,
  10. primaryColor: state => state.app.color,
  11. colorWeak: state => state.app.weak,
  12. multipage: state => state.app.multipage,//多页签设置
  13. fixedHeader: state => state.app.fixedHeader,
  14. fixSiderbar: state => state.app.fixSiderbar,
  15. contentWidth: state => state.app.contentWidth,
  16. autoHideHeader: state => state.app.autoHideHeader,
  17. sidebarOpened: state => state.app.sidebar.opened
  18. })
  19. }
  20. }
  21. const mixinDevice = {
  22. computed: {
  23. ...mapState({
  24. device: state => state.app.device,
  25. })
  26. },
  27. methods: {
  28. isMobile () {
  29. return this.device === 'mobile'
  30. },
  31. isDesktop () {
  32. return this.device === 'desktop'
  33. }
  34. }
  35. }
  36. export { mixin, mixinDevice }