fix: 移除无用的滚动事件处理和相关方法,优化组件加载逻辑

This commit is contained in:
yangzhe 2025-07-11 14:34:12 +08:00
parent 1a05539731
commit cceb6eed43
1 changed files with 3 additions and 25 deletions

View File

@ -84,8 +84,6 @@
scroll-with-animation scroll-with-animation
:scroll-top="scrollTop" :scroll-top="scrollTop"
:show-scrollbar="true" :show-scrollbar="true"
@scrolltoupper="loadMoreMessages"
@scroll="onScroll"
> >
<!-- 头部卡片 --> <!-- 头部卡片 -->
<!-- 后端让先注释 --> <!-- 后端让先注释 -->
@ -380,16 +378,7 @@ export default {
}, },
}, },
onLoad() {}, onLoad() {},
mounted() { mounted() {},
this.$nextTick(() => {
this.scrollToBottom();
});
},
updated() {
this.$nextTick(() => {
this.scrollToBottom();
});
},
methods: { methods: {
handleLeftClick() { handleLeftClick() {
this.$u.api.GetConversationPage().then((res) => { this.$u.api.GetConversationPage().then((res) => {
@ -415,16 +404,6 @@ export default {
}); });
}, },
selectChatItem(index) {
this.activeIndex = index;
},
loadMoreMessages() {
//
console.log("加载更多历史消息");
},
onScroll(event) {
//
},
scrollToBottom() { scrollToBottom() {
// 使nextTickDOM // 使nextTickDOM
this.$nextTick(() => { this.$nextTick(() => {
@ -434,6 +413,7 @@ export default {
.select(".chat-content") .select(".chat-content")
.boundingClientRect((data) => { .boundingClientRect((data) => {
if (data) { if (data) {
console.log("data", data);
// //
const scrollHeight = data.height; const scrollHeight = data.height;
// 100px // 100px
@ -558,8 +538,6 @@ export default {
// //
return timeA - timeB; return timeA - timeB;
}); });
this.scrollToBottom();
}); });
}, },
@ -588,7 +566,7 @@ page {
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
background-position: 0 88rpx; background-position: 0 88rpx;
// overflow: hidden; /* hidden */ background-attachment: fixed;
} }
.home-container { .home-container {