<template>
  <div class="mainFrame">
    <el-container>
      <el-header>
        <navbar @collapseControl="Collapse"></navbar>
      </el-header>
      <el-container>
        <el-aside :width="isCollapse ? '64px' : '200px'">
          <sidebar :isCollapse="isCollapse"></sidebar>
        </el-aside>
        <el-container>
          <el-main>
            <router-view/>
          </el-main>
        </el-container>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import navbar from '@/layout/Navbar'
import sidebar from '@/layout/Sidebar'
export default {
  components: { navbar, sidebar },
  data() {
    return {
      isCollapse: '',
    }
  },
  methods: {
    Collapse(val) {
      this.isCollapse = val;
    }
  }
}
</script>

<style lang="less" scoped>
.mainFrame {
  width: 100%;
  height: 100%;
}

.el-container {
  height: 100%;
  overflow: hidden;
}

.el-header {
  left: 0px;
  top: 0px;
  height: 64px !important;
  line-height: 20px;
  background-image: url('@/assets/background/background@3x.png');
  text-align: center;
  box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.15);
}

.el-aside {
  left: 0px;
  top: 64px;
  color: rgba(16, 16, 16, 1);
  line-height: 20px;
  background-color: #266999;
  color: rgba(16, 16, 16, 1);
  font-size: 14px;
  text-align: center;
  overflow-x: hidden;
  transition: width 0.25s;
  -webkit-transition: width 0.25s;
  -moz-transition: width 0.25s;
  -o-transition: width 0.25s;
}

.el-main {
  background-color: #E9EEF3;
  color: #333;
  height: 100%;
  width: 100%;
}
</style>