6 changed files with 231 additions and 107 deletions
@ -0,0 +1,24 @@ |
|||||
|
// Base |
||||
|
$base--line-height: 1.15; |
||||
|
|
||||
|
// Navbar |
||||
|
$navbar--height: 75px; |
||||
|
|
||||
|
// Sidebar |
||||
|
$sidebar--width: 230px; |
||||
|
$sidebar--width-fold: 100px; |
||||
|
$sidebar--background-color-dark: #263238; |
||||
|
$sidebar--text-color-dark: #8a979e; |
||||
|
$sidebar--menu-item-height: 48px; |
||||
|
|
||||
|
// Content |
||||
|
$content--padding: 10px; |
||||
|
$content--background-color: #f1f4f5; |
||||
|
$content--card-header-height: 60px; |
||||
|
$content--tabs-header-height: 38px; |
||||
|
// Content, 填充整屏高度(非tabs状态) = 整屏高度 - 导航条高度 - aui-content上下内边距高度 |
||||
|
$content--fill-height: calc(100vh - #{$navbar--height} - #{$content--padding * 2}); |
||||
|
// Content, 填充整屏高度(是tabs状态) = 整屏高度 - 导航条高度 - tabs组件header高度 - tabs组件content上下内边距高度 |
||||
|
$content--fill-height-tabs: calc( |
||||
|
100vh - #{$navbar--height} - #{$content--tabs-header-height} - #{$content--padding * 2} |
||||
|
); |
@ -0,0 +1,62 @@ |
|||||
|
<template> |
||||
|
<div class="g-app"> |
||||
|
<div class="g-bd" :style="bdStyle"> |
||||
|
<slot></slot> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
clientHeight: document.documentElement.clientHeight, |
||||
|
clientWidth: document.documentElement.clientWidth, |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
components: {}, |
||||
|
computed: { |
||||
|
bdStyle() { |
||||
|
const { clientHeight, clientWidth } = this; |
||||
|
console.log("clientHeight", clientHeight); |
||||
|
const scale = clientWidth / 1920; |
||||
|
const height = clientHeight / scale; |
||||
|
const top = (clientHeight - height) / 2; |
||||
|
const left = (clientWidth - 1920) / 2; |
||||
|
this.$store.state.fixed1920.height = height; |
||||
|
return { |
||||
|
transform: `scale(${scale})`, |
||||
|
height: `${height}px`, |
||||
|
left: `${left}px`, |
||||
|
top: `${top}px`, |
||||
|
}; |
||||
|
}, |
||||
|
}, |
||||
|
created() {}, |
||||
|
mounted() { |
||||
|
window.addEventListener("resize", () => { |
||||
|
this.clientHeight = document.documentElement.clientHeight; |
||||
|
this.clientWidth = document.documentElement.clientWidth; |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
methods: {}, |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.g-app { |
||||
|
position: absolute; |
||||
|
// width: 1920px; |
||||
|
width: 100%; |
||||
|
height: 100vh; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
|
||||
|
.g-bd { |
||||
|
position: absolute; |
||||
|
width: 1920px; |
||||
|
overflow-x: hidden; |
||||
|
overflow-y: auto; |
||||
|
} |
||||
|
</style> |
Loading…
Reference in new issue