<template>
  <div id="app">
    <!-- <nav>
      <router-link to="/">Home</router-link> |
      <router-link to="/about">About</router-link> |
      <router-link to="/ui">组件示例文件</router-link>
    </nav> -->
    <!-- <router-view/> -->
    <el-container>
      <el-header>
        <Header></Header>
      </el-header>
      <el-container>
        <SliderMenu v-if="showSidebar"></SliderMenu>
        <el-container>
          <el-main>
            <router-view/>
          </el-main>
          <el-footer v-if="showFooter">
            <Footer></Footer>
          </el-footer>

        </el-container>
      </el-container>
    </el-container>
  </div>
</template>
<script>
import SliderMenu from '@/components/SliderMenu.vue';
import Footer from '@/components/Footer.vue';
import { mapState } from 'vuex';
import Header from './components/Header.vue';
export default {
  data() {
    return {
      isCollapse: true
    };
  },
  components: {
    SliderMenu,
    Footer,
    Header
  },
  computed: {
    ...mapState(['showSidebar,showFooter']) // 从Vuex映射showSidebar状态到组件的计算属性中
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    }
  }
}
</script>
<style lang="scss">
body{
  font-family: Microsoft YaHei UI;
  font-size: 14px;
  margin: 0;
  width: 100vw;
  height: 100vh;
  p{
      margin: 0;
      padding: 0;
  }
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  font-family: Microsoft YaHei UI;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  height: 100%;
}

nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
