hookehuyr

fix 通用顶部图片高度修改

/*
* @Date: 2022-07-26 09:49:54
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-10-24 11:02:47
* @LastEditTime: 2024-10-25 18:28:35
* @FilePath: /hager/src/common/mixin.js
* @Description: 文件描述
*/
......@@ -17,8 +17,6 @@ export default {
this.handleResize();
// 监听窗口的 resize 事件
window.addEventListener('resize', this.handleResize);
// 高度监听
this.top_img_height = $(window).width()*0.38 + 'px';
},
beforeDestroy() {
// 在组件销毁前移除监听器,防止内存泄漏
......@@ -41,9 +39,8 @@ export default {
if (this.screenWidth < 768) {
this.top_img_height = '20vh';
} else {
this.top_img_height = '38rem';
this.top_img_height = $(window).width()*0.35 + 'px';
}
this.top_img_height = $(window).width()*0.38 + 'px';
},
},
directives: {
......