1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/tmpan-vue-admin

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
Layout.vue 1.7 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
tieminPan Отправлено 6 лет назад 5359a85
<template>
<div :class="classObj" class="app-wrapper ">
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
<sidebar class="sidebar-container"/>
<div class="main-container">
<navbar class="nav-div"/>
<app-main class="main-div"/>
</div>
</div>
</template>
<script>
import { Navbar, Sidebar, AppMain } from './components'
import ResizeMixin from './mixin/ResizeHandler'
export default {
name: 'Layout',
components: {
Navbar,
Sidebar,
AppMain
},
mixins: [ResizeMixin],
computed: {
sidebar() {
return this.$store.state.app.sidebar
},
device() {
return this.$store.state.app.device
},
classObj() {
return {
hideSidebar: !this.sidebar.opened,
openSidebar: this.sidebar.opened,
withoutAnimation: this.sidebar.withoutAnimation,
mobile: this.device === 'mobile'
}
}
},
methods: {
handleClickOutside() {
this.$store.dispatch('CloseSideBar', { withoutAnimation: false })
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.app-wrapper {
@include clearfix;
position: relative;
height: 100%;
width: 100%;
&.mobile.openSidebar {
position: fixed;
top: 0;
}
}
.drawer-bg {
background: #000;
opacity: 0.3;
width: 100%;
top: 0;
height: 100%;
position: absolute;
z-index: 999;
}
.main-div {
margin-left: 1rem;
margin-right: 1rem;
margin-top: 2rem;
/*padding-top: 4rem;*/
}
/*.nav-div {*/
/*position: fixed;*/
/*top: 0;*/
/*width: 100%;*/
/*z-index: 1;*/
/*background-color: white;*/
/*}*/
</style>

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://gitlife.ru/oschina-mirror/tmpan-vue-admin.git
git@gitlife.ru:oschina-mirror/tmpan-vue-admin.git
oschina-mirror
tmpan-vue-admin
tmpan-vue-admin
master