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-24 18:13:17 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c52796383242e1566611dc05aefffbeb7102a172
c5279638
1 parent
f04d08cc
fix IE注册页面高度遮挡问题
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
src/views/user/index.vue
src/views/user/index.vue
View file @
c527963
<!--
* @Date: 2024-10-18 17:57:33
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-10-2
2 17:57:02
* @LastEditTime: 2024-10-2
4 18:11:00
* @FilePath: /hager/src/views/user/index.vue
* @Description: 文件描述
-->
...
...
@@ -44,14 +44,24 @@ export default {
// 设置用户盒子高度
// 监听窗口的 resize 事件
window.addEventListener('resize', this.handleHeight);
this.overflowScroll();
},
watch: {
'$route.path' (to, from) { // 路由变化
this.overflowScroll();
}
},
methods: {
overflowScroll () {
this.$nextTick(() => {
// 判断是否被遮挡,让屏幕能滚动
if (!this.isElementInViewport('#router-view')) { // #router-view 被屏幕遮挡
$('.hager-user-page').css('height', 'auto')
} else {
$('.hager-user-page').css('height', '100vh')
}
})
},
methods: {
handleHeight () {
//
// if ($('#router-view').outerHeight() > $('.user-box').height()) {
...
...
@@ -60,12 +70,7 @@ export default {
if ($('#router-view').outerHeight() < $('.user-box').height()) {
$('#router-view').height($('.user-box').outerHeight())
}
// 判断是否被遮挡,让屏幕能滚动
if (!this.isElementInViewport('#router-view')) { // #router-view 被屏幕遮挡
$('.hager-user-page').css('height', 'auto')
} else {
$('.hager-user-page').css('height', '100vh')
}
this.overflowScroll();
},
isElementInViewport(element) {
var rect = $(element)[0].getBoundingClientRect(); // 获取元素相对于视口的大小和位置
...
...
Please
register
or
login
to post a comment