<template>
  <div>
    <el-container>
      <el-aside v-if="showComponents" width="200px">
        <Sidebar />
      </el-aside>
      <el-container style="display:block">
        <Navbar v-if="showComponents" />
          <app-main />
      </el-container>
    </el-container>
  </div>
</template>
<script>
import Navbar from './components/Navbar.vue'
import AppMain from './components/AppMain.vue'
import Sidebar from './components/Sidebar/menu'
export default {
  components: {
    Navbar,
    AppMain,
    Sidebar
  },
  computed: {
    // 是否显示顶部栏、菜单栏
    showComponents() {
      if (this.$route.path != '/') {
        return true
      } else {
        return false
      }
    }
  }
}
</script>
