Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
hager
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2024-10-12 15:18:45 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4ebdcc71638aa37802a71821e4ba6112c506880a
4ebdcc71
1 parent
c1e14c54
✨ feat: 新增头部信息滚动隐藏的功能
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
src/App.vue
src/components/common/hagerHeader.vue
src/App.vue
View file @
4ebdcc7
<!--
* @Date: 2024-09-26 13:36:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-10-1
0 13:54:25
* @LastEditTime: 2024-10-1
2 15:17:28
* @FilePath: /hager/src/App.vue
* @Description: 文件描述
-->
...
...
@@ -60,7 +60,7 @@ body {
}
.wrapper {
margin-top:
5
rem;
margin-top:
7
rem;
flex-grow: 1;
&.xs {
margin-top: 7rem;
...
...
src/components/common/hagerHeader.vue
View file @
4ebdcc7
<!--
* @Date: 2024-09-26 13:42:11
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-10-12 1
1:52
:42
* @LastEditTime: 2024-10-12 1
5:16
:42
* @FilePath: /hager/src/components/common/hagerHeader.vue
* @Description: 文件描述
-->
<template>
<div class="hager-header">
<div class="header-top"></div>
<el-row class="hidden-xs-only" style="background-color: #fff;">
<el-col :sm="1" :md="1" :lg="3" :xl="4"> </el-col>
<el-col :sm="22" :md="22" :lg="18" :xl="16" style="position: relative;height: 5rem;">
...
...
@@ -264,6 +265,14 @@ export default {
this.product_info = this.product_menu[0]['info'];
// 修改数据结构显示
this.product_info.product = this.splitProductList(this.product_info.product);
// 监听屏幕滚动
window.addEventListener('scroll', (evt) => {
if ($(window).scrollTop()) {
$('.header-top').css('height', 0);
} else {
$('.header-top').css('height', '2rem');
}
})
},
watch: {
'$route' (to, from) {
...
...
@@ -373,6 +382,12 @@ export default {
left: 0;
right: 0;
z-index: 9;
.header-top {
display: flex;
background-color: #00477e;
height: 2rem;
transition: all .4s ease-in-out;
}
.product-center {
position: absolute;
top: 5rem;
...
...
Please
register
or
login
to post a comment