2019-06-03 03:31:38 +00:00
|
|
|
<template>
|
2020-05-25 00:02:28 +00:00
|
|
|
<div
|
|
|
|
class="container"
|
|
|
|
:class="theme"
|
|
|
|
>
|
2020-08-08 20:18:55 +00:00
|
|
|
<transition name="slide">
|
|
|
|
<Sidebar
|
|
|
|
v-if="showSidebar"
|
|
|
|
@toggle="(state) => showSidebar = state"
|
|
|
|
/>
|
|
|
|
</transition>
|
2020-03-25 01:48:54 +00:00
|
|
|
|
2020-05-25 00:02:28 +00:00
|
|
|
<Header :toggle-sidebar="toggleSidebar" />
|
2019-06-03 03:31:38 +00:00
|
|
|
|
2020-05-25 00:02:28 +00:00
|
|
|
<div class="content">
|
|
|
|
<router-view />
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-06-03 03:31:38 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-03-23 00:43:49 +00:00
|
|
|
import { mapState } from 'vuex';
|
|
|
|
|
2020-03-25 01:48:54 +00:00
|
|
|
import EventBus from '../../js/event-bus';
|
|
|
|
|
2019-06-03 03:31:38 +00:00
|
|
|
import Header from '../header/header.vue';
|
2020-03-25 01:48:54 +00:00
|
|
|
import Sidebar from '../sidebar/sidebar.vue';
|
2019-06-03 03:31:38 +00:00
|
|
|
|
2020-03-23 00:43:49 +00:00
|
|
|
function theme(state) {
|
2020-05-25 00:02:28 +00:00
|
|
|
return state.ui.theme;
|
2020-03-23 00:43:49 +00:00
|
|
|
}
|
|
|
|
|
2020-03-25 01:48:54 +00:00
|
|
|
function toggleSidebar(state) {
|
2020-05-25 00:02:28 +00:00
|
|
|
this.showSidebar = typeof state === 'boolean' ? state : !this.showSidebar;
|
2020-03-25 01:48:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function mounted() {
|
2020-05-25 00:02:28 +00:00
|
|
|
document.addEventListener('click', () => {
|
|
|
|
EventBus.$emit('blur');
|
|
|
|
});
|
2020-03-25 01:48:54 +00:00
|
|
|
}
|
|
|
|
|
2019-06-03 03:31:38 +00:00
|
|
|
export default {
|
2020-05-25 00:02:28 +00:00
|
|
|
components: {
|
|
|
|
Header,
|
|
|
|
Sidebar,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
showSidebar: false,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapState({
|
|
|
|
theme,
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
mounted,
|
|
|
|
methods: {
|
|
|
|
toggleSidebar,
|
|
|
|
},
|
2019-06-03 03:31:38 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
2019-10-28 01:54:37 +00:00
|
|
|
<style lang="scss">
|
2019-11-14 00:18:19 +00:00
|
|
|
@import 'theme';
|
|
|
|
|
2019-09-24 23:38:06 +00:00
|
|
|
.container {
|
2020-03-25 01:48:54 +00:00
|
|
|
position: relative;
|
2019-09-24 23:38:06 +00:00
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
overflow: hidden;
|
2020-05-25 00:02:28 +00:00
|
|
|
background: var(--background-soft);
|
2020-03-27 03:39:13 +00:00
|
|
|
color: var(--text);
|
2019-09-24 23:38:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.content {
|
2019-10-28 01:54:37 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2019-09-24 23:38:06 +00:00
|
|
|
flex-grow: 1;
|
2019-11-14 00:18:19 +00:00
|
|
|
overflow-y: auto;
|
2020-06-29 23:07:48 +00:00
|
|
|
overflow-x: hidden;
|
2019-09-24 23:38:06 +00:00
|
|
|
}
|
|
|
|
|
2019-06-03 03:31:38 +00:00
|
|
|
.content-inner {
|
2020-09-09 02:22:43 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2020-06-27 02:50:13 +00:00
|
|
|
flex-grow: 1;
|
|
|
|
overflow-y: auto;
|
2020-07-02 23:28:22 +00:00
|
|
|
overflow-x: hidden;
|
2020-08-17 13:53:20 +00:00
|
|
|
box-shadow: 0 0 3px var(--shadow-weak);
|
|
|
|
z-index: 1;
|
2019-06-03 03:31:38 +00:00
|
|
|
}
|
2020-08-08 20:18:55 +00:00
|
|
|
|
|
|
|
.slide-enter-active,
|
|
|
|
.slide-leave-active {
|
|
|
|
&.sidebar-container {
|
2020-09-11 01:13:51 +00:00
|
|
|
transition: background .15s ease-in-out;
|
2020-08-08 20:18:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar {
|
2020-09-11 01:13:51 +00:00
|
|
|
transition: transform .15s ease-in-out;
|
2020-08-08 20:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.slide-enter,
|
|
|
|
.slide-leave-to {
|
|
|
|
&.sidebar-container {
|
|
|
|
background: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar {
|
2020-09-11 01:13:51 +00:00
|
|
|
transform: translate(100%, 0);
|
2020-08-08 20:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
2020-08-12 01:30:20 +00:00
|
|
|
|
|
|
|
.column {
|
|
|
|
width: 1200px;
|
|
|
|
max-width: 100%;
|
|
|
|
padding: 0 1rem;
|
|
|
|
margin: 0 auto;
|
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
2019-06-03 03:31:38 +00:00
|
|
|
</style>
|