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 11:11:51 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c3b9ccaa9253fd66c6f6650468d8e71a9177f607
c3b9ccaa
1 parent
870a1247
首页高度自适应
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
src/common/mixin.js
src/views/index.vue
src/common/mixin.js
View file @
c3b9cca
/*
* @Date: 2022-07-26 09:49:54
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-10-2
1 16:45:53
* @LastEditTime: 2024-10-2
4 11:02:47
* @FilePath: /hager/src/common/mixin.js
* @Description: 文件描述
*/
...
...
@@ -17,6 +17,8 @@ export default {
this
.
handleResize
();
// 监听窗口的 resize 事件
window
.
addEventListener
(
'resize'
,
this
.
handleResize
);
// 高度监听
this
.
top_img_height
=
$
(
window
).
width
()
*
0.38
+
'px'
;
},
beforeDestroy
()
{
// 在组件销毁前移除监听器,防止内存泄漏
...
...
@@ -41,6 +43,7 @@ export default {
}
else
{
this
.
top_img_height
=
'38rem'
;
}
this
.
top_img_height
=
$
(
window
).
width
()
*
0.38
+
'px'
;
},
},
directives
:
{
...
...
src/views/index.vue
View file @
c3b9cca
<!--
* @Date: 2024-08-27 10:06:30
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-10-24 1
0:52:43
* @LastEditTime: 2024-10-24 1
1:08:47
* @FilePath: /hager/src/views/index.vue
* @Description: 首页
-->
...
...
@@ -184,6 +184,7 @@ import hagerBox from '@/components/common/hagerBox';
import hagerH1 from '@/components/common/hagerH1.vue';
import hagerMore from '@/components/hagerMore.vue';
import { getHomeAPI } from "@/api/hager.js";
import $ from 'jquery';
export default {
mixins: [mixin.init],
...
...
Please
register
or
login
to post a comment