fix: 画布优化

This commit is contained in:
jeo young
2022-12-16 19:08:34 +08:00
parent 0cd31f48c1
commit b308275d99
8 changed files with 289 additions and 81 deletions
+27 -9
View File
@@ -18,14 +18,14 @@
</n-space>
</div>
<div
class="content"
:class="{
'content-height-show-top-bottom': showBottom || showTop,
'content-height-show-both': showBottom && showTop
}"
>
<template v-if="xScroll">
<div class="content" :class="{
'content-height-show-top-bottom': showBottom || showTop,
'content-height-show-both': showBottom && showTop
}">
<template v-if="disabledScroll">
<slot></slot>
</template>
<template v-else-if="xScroll">
<n-scrollbar x-scrollable>
<n-scrollbar>
<slot></slot>
@@ -83,7 +83,11 @@ defineProps({
xScroll: {
type: Boolean,
default: false
}
},
disabledScroll: {
type: Boolean,
default: false
},
})
const backHandle = () => {
@@ -93,41 +97,52 @@ const backHandle = () => {
<style lang="scss" scoped>
$topOrBottomHeight: 40px;
@include go(content-box) {
height: calc(100vh - #{$--header-height});
margin: 1px;
margin-bottom: 0;
&.bg-depth0 {
@include fetch-bg-color('background-color1');
.bottom,
.top {
@include fetch-bg-color('background-color1');
}
}
&.bg-depth1 {
@include fetch-bg-color('background-color1');
.bottom,
.top {
@include fetch-bg-color('background-color2');
}
}
&.bg-depth2 {
@include fetch-bg-color('background-color2');
.bottom,
.top {
@include fetch-bg-color('background-color3');
}
}
&.bg-depth3 {
@include fetch-bg-color('background-color3');
.bottom,
.top {
@include fetch-bg-color('background-color4');
}
}
&.flex {
flex: 1;
}
.top,
.bottom {
display: flex;
@@ -138,10 +153,12 @@ $topOrBottomHeight: 40px;
padding: 0 10px;
border-top: 1px solid;
@include fetch-border-color('hover-border-color');
.mt-1 {
margin-top: 2px;
}
}
.top {
border-bottom: 1px solid;
@include fetch-border-color('background-color1');
@@ -159,6 +176,7 @@ $topOrBottomHeight: 40px;
.content-height-show-top-bottom {
height: calc(100vh - #{$--header-height} - #{$topOrBottomHeight});
}
.content-height-show-both {
height: calc(100vh - #{$--header-height} - #{$topOrBottomHeight} - #{$topOrBottomHeight});
}