<template>
  <Layout :style="{'overflow-x': 'hidden'}" class="main">
    <main-header v-if="headType==0"/>
    <main-frame frameName="main" />
  </Layout>
</template>

<script>
import { mapState,mapMutations, mapActions } from 'vuex'
import routers from '@/router/routers'
import mainHeader from '@@c/main-header'
import mainFrame from '@@c/main-frame'

export default {
  name: 'Main',
  components: {
    mainHeader,
    mainFrame
  },
  methods: {
    ...mapMutations([
      'setBreadCrumb',
      'setHomeRoute'
    ]),
    ...mapActions(['getUserInfo','getLoginType']),
    name () {}
  },
  watch: {
    $route (newRoute) {
      this.setBreadCrumb(newRoute)
    }
  },
  computed: {
    ...mapState({
      headType: state => state.user.headType
    })
  },
  created () {
    this.getLoginType()//获取HeadType的方法
    this.getUserInfo()
    // console.log('route', this.$route)
    this.setHomeRoute(routers)
    this.setBreadCrumb(this.$route)
    //console.log(this.headType);
  },
  mounted () {
  }
}
</script>
