Skip to content

Commit

Permalink
fix scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
jangholi committed Feb 27, 2024
1 parent 70f0408 commit 8b41dcc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const log = (user: string, ...args: string[]) => {
user: user,
created_at: new Date().toLocaleString(),
});
scroll();
};
const connect = async () => {
Expand Down Expand Up @@ -55,6 +56,13 @@ const clear = () => {
log("system", "previous messages cleared");
};
const scroll = () => {
nextTick(() => {
console.log('scrooling')
window.scrollTo(0, document.body.scrollHeight + 100);
})
}
const send = () => {
console.log("sending message...");
if (message.value) {
Expand All @@ -70,6 +78,7 @@ const ping = () => {
onMounted(async () => {
connect();
scroll();
});
useServerHead({
Expand Down

0 comments on commit 8b41dcc

Please sign in to comment.