|
@ -1,11 +1,22 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div :class="classObj" class="app-wrapper" :style="{'--current-color': theme}"> |
|
|
<div |
|
|
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/> |
|
|
:class="classObj" |
|
|
|
|
|
class="app-wrapper" |
|
|
|
|
|
:style="{ '--current-color': theme }" |
|
|
|
|
|
> |
|
|
|
|
|
<div |
|
|
|
|
|
v-if="device === 'mobile' && sidebar.opened" |
|
|
|
|
|
class="drawer-bg" |
|
|
|
|
|
@click="handleClickOutside" |
|
|
|
|
|
/> |
|
|
<sidebar v-if="!sidebar.hide" class="sidebar-container" /> |
|
|
<sidebar v-if="!sidebar.hide" class="sidebar-container" /> |
|
|
<div :class="{hasTagsView:needTagsView,sidebarHide:sidebar.hide}" class="main-container"> |
|
|
<div |
|
|
|
|
|
:class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }" |
|
|
|
|
|
class="main-container" |
|
|
|
|
|
> |
|
|
<div :class="{ 'fixed-header': fixedHeader }"> |
|
|
<div :class="{ 'fixed-header': fixedHeader }"> |
|
|
<navbar /> |
|
|
<navbar /> |
|
|
<tags-view v-if="needTagsView"/> |
|
|
<!-- <tags-view v-if="needTagsView"/> --> |
|
|
</div> |
|
|
</div> |
|
|
<app-main /> |
|
|
<app-main /> |
|
|
<right-panel> |
|
|
<right-panel> |
|
@ -16,50 +27,50 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import RightPanel from '@/components/RightPanel' |
|
|
import RightPanel from "@/components/RightPanel"; |
|
|
import { AppMain, Navbar, Settings, Sidebar, TagsView } from './components' |
|
|
import { AppMain, Navbar, Settings, Sidebar, TagsView } from "./components"; |
|
|
import ResizeMixin from './mixin/ResizeHandler' |
|
|
import ResizeMixin from "./mixin/ResizeHandler"; |
|
|
import { mapState } from 'vuex' |
|
|
import { mapState } from "vuex"; |
|
|
import variables from '@/assets/styles/variables.scss' |
|
|
import variables from "@/assets/styles/variables.scss"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: 'Layout', |
|
|
name: "Layout", |
|
|
components: { |
|
|
components: { |
|
|
AppMain, |
|
|
AppMain, |
|
|
Navbar, |
|
|
Navbar, |
|
|
RightPanel, |
|
|
RightPanel, |
|
|
Settings, |
|
|
Settings, |
|
|
Sidebar, |
|
|
Sidebar, |
|
|
TagsView |
|
|
TagsView, |
|
|
}, |
|
|
}, |
|
|
mixins: [ResizeMixin], |
|
|
mixins: [ResizeMixin], |
|
|
computed: { |
|
|
computed: { |
|
|
...mapState({ |
|
|
...mapState({ |
|
|
theme: state => state.settings.theme, |
|
|
theme: (state) => state.settings.theme, |
|
|
sideTheme: state => state.settings.sideTheme, |
|
|
sideTheme: (state) => state.settings.sideTheme, |
|
|
sidebar: state => state.app.sidebar, |
|
|
sidebar: (state) => state.app.sidebar, |
|
|
device: state => state.app.device, |
|
|
device: (state) => state.app.device, |
|
|
needTagsView: state => state.settings.tagsView, |
|
|
needTagsView: (state) => state.settings.tagsView, |
|
|
fixedHeader: state => state.settings.fixedHeader |
|
|
fixedHeader: (state) => state.settings.fixedHeader, |
|
|
}), |
|
|
}), |
|
|
classObj() { |
|
|
classObj() { |
|
|
return { |
|
|
return { |
|
|
hideSidebar: !this.sidebar.opened, |
|
|
hideSidebar: !this.sidebar.opened, |
|
|
openSidebar: this.sidebar.opened, |
|
|
openSidebar: this.sidebar.opened, |
|
|
withoutAnimation: this.sidebar.withoutAnimation, |
|
|
withoutAnimation: this.sidebar.withoutAnimation, |
|
|
mobile: this.device === 'mobile' |
|
|
mobile: this.device === "mobile", |
|
|
} |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
variables() { |
|
|
variables() { |
|
|
return variables; |
|
|
return variables; |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
handleClickOutside() { |
|
|
handleClickOutside() { |
|
|
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false }) |
|
|
this.$store.dispatch("app/closeSideBar", { withoutAnimation: false }); |
|
|
} |
|
|
}, |
|
|
} |
|
|
}, |
|
|
} |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
|