Blame view

src/layout/index.vue 1.44 KB
1 2 3 4 5
<!--
 * @Description: 
 * @Autor: renchao
 * @LastEditTime: 2023-07-25 16:10:52
-->
赵千 committed
6
<template>
任超 committed
7
  <div class="app-wrapper">
任超 committed
8
    <navbar />
赵千 committed
9 10
    <div :class="{ hasTagsView: needTagsView }" class="main-container">
      <div :class="{ 'fixed-header': fixedHeader }">
任超 committed
11
        <sidebar class="sidebar-container" />
赵千 committed
12 13 14 15 16 17 18
        <tags-view v-if="needTagsView" />
      </div>
      <app-main />
    </div>
  </div>
</template>
<script>
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
  import { AppMain, Navbar, Sidebar, TagsView } from './components'
  import ResizeMixin from './mixin/ResizeHandler'
  import { mapState } from 'vuex'
  export default {
    name: 'Layout',
    components: {
      AppMain,
      Navbar,
      Sidebar,
      TagsView
    },
    mixins: [ResizeMixin],
    computed: {
      ...mapState({
        sidebar: state => state.app.sidebar,
        needTagsView: state => state.settings.tagsView,
        fixedHeader: state => state.settings.fixedHeader
      })
    }
赵千 committed
38 39 40
  }
</script>
<style lang="scss" scoped>
41
  @import "~@/styles/mixin.scss";
赵千 committed
42

43 44 45 46 47
  .app-wrapper {
    @include clearfix;
    position: relative;
    height: 100%;
    width: 100%;
赵千 committed
48

49 50 51 52
    &.mobile.openSidebar {
      position: fixed;
      top: 0;
    }
赵千 committed
53 54
  }

55 56 57 58 59 60 61 62 63
  .drawer-bg {
    background: #000;
    opacity: 0.3;
    width: 100%;
    top: 0;
    height: 100%;
    position: absolute;
    z-index: 999;
  }
赵千 committed
64

65 66 67 68
  .fixed-header {
    width: 100%;
    transition: width 0.28s;
  }
赵千 committed
69

70 71 72 73
  .el-dropdown-menu--small {
    padding: 0;
    width: 5px;
  }
赵千 committed
74
</style>