mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 04:09:29 +02:00
Test scroll bar logic
This commit is contained in:
@@ -46,6 +46,12 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
ScrollToBottom() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
const chatContent = this.$el.querySelector(".chat__content--users");
|
||||||
|
chatContent.scrollTop = chatContent.scrollHeight;
|
||||||
|
});
|
||||||
|
},
|
||||||
ClaimDatamsg(msg) {
|
ClaimDatamsg(msg) {
|
||||||
SendMessageToChat(msg[0]);
|
SendMessageToChat(msg[0]);
|
||||||
|
|
||||||
@@ -70,6 +76,8 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.array.push(MsgUser);
|
this.array.push(MsgUser);
|
||||||
|
|
||||||
|
// this.ScrollToBottom();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error parsing JSON data:", error);
|
console.error("Error parsing JSON data:", error);
|
||||||
}
|
}
|
||||||
@@ -78,8 +86,7 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
GetChatHistory().then((response) => {
|
GetChatHistory().then((response) => {
|
||||||
response.forEach((element) => {
|
response.forEach((element) => {
|
||||||
let imageUrl =
|
let imageUrl = "https://avatar.spworlds.ru/face/55/" + element.userName;
|
||||||
"https://avatar.spworlds.ru/face/55/" + element.userName;
|
|
||||||
|
|
||||||
const MsgUser = {
|
const MsgUser = {
|
||||||
id: this.id + 1,
|
id: this.id + 1,
|
||||||
@@ -90,6 +97,7 @@ export default {
|
|||||||
|
|
||||||
this.array.push(MsgUser);
|
this.array.push(MsgUser);
|
||||||
});
|
});
|
||||||
|
this.ScrollToBottom();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user