Skip to content

Commit

Permalink
Merge pull request #306 from Fuynkio/dev_shawn
Browse files Browse the repository at this point in the history
 改回去 ui/src/pages/Home.vue
  • Loading branch information
ZhaoZuohong authored Sep 23, 2023
2 parents d8356b5 + e9fbfa0 commit a3e1a49
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ui/src/pages/Home.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup>
import { useMowerStore } from '@/stores/mower'
import { storeToRefs } from 'pinia'
import { onMounted, inject, nextTick } from 'vue'
import { onMounted, inject, nextTick, watch } from 'vue'
const mower_store = useMowerStore()
Expand All @@ -14,6 +14,19 @@ function scroll_last_line() {
})
}
function scroll_log() {
const container = document.querySelector('.n-scrollbar-container')
const content = document.querySelector('.n-scrollbar-content')
if (container.scrollTop + container.clientHeight < content.clientHeight) {
return
}
scroll_last_line()
}
watch(log, () => {
scroll_log()
})
onMounted(() => {
scroll_last_line()
})
Expand Down

0 comments on commit a3e1a49

Please sign in to comment.