style(header): use sticky replace fixed

This commit is contained in:
0xJacky 2023-05-05 14:35:21 +08:00
parent 716858ebdc
commit 9eab625ee5
No known key found for this signature in database
GPG key ID: B6E4A6E4A561BAF0
2 changed files with 3 additions and 8 deletions

View file

@ -64,7 +64,7 @@ const lang = computed(() => {
</a-layout-sider> </a-layout-sider>
<a-layout> <a-layout>
<a-layout-header :style="{position: 'fixed', zIndex: 10, width:'100%'}"> <a-layout-header :style="{position: 'sticky', top: '0', zIndex: 10, width:'100%'}">
<header-layout @clickUnFold="drawer_visible=true"/> <header-layout @clickUnFold="drawer_visible=true"/>
</a-layout-header> </a-layout-header>
@ -104,9 +104,6 @@ const lang = computed(() => {
<style lang="less"> <style lang="less">
.layout-sider .sidebar { .layout-sider .sidebar {
//position: fixed;
//width: 200px;
ul.ant-menu-inline.ant-menu-root { ul.ant-menu-inline.ant-menu-root {
height: calc(100vh - 120px); height: calc(100vh - 120px);
overflow-y: auto; overflow-y: auto;
@ -237,7 +234,6 @@ body {
} }
.ant-layout-content { .ant-layout-content {
margin: 64px 0;
min-height: auto; min-height: auto;
.router-view { .router-view {

View file

@ -49,7 +49,6 @@ function logout() {
padding: 0 20px 0 0; padding: 0 20px 0 0;
background: transparent; background: transparent;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.05); box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.05);
position: fixed;
width: 100%; width: 100%;
a { a {
@ -68,7 +67,7 @@ function logout() {
} }
.tool { .tool {
position: fixed; position: absolute;
left: 20px; left: 20px;
@media (min-width: 600px) { @media (min-width: 600px) {
display: none; display: none;
@ -76,7 +75,7 @@ function logout() {
} }
.user-wrapper { .user-wrapper {
position: fixed; position: absolute;
right: 28px; right: 28px;
} }