Skip to content

Commit

Permalink
修复点击切换气泡显示模式就滚动到底部的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
keysking committed Apr 22, 2023
1 parent 5450911 commit 6f2dc01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
## TODO
- 使用worker重构
- SEO优化
- 连续发送粘包问题
- 修复RTS拉高部分板子boot0的问题
- 有小伙伴想要十进制显示
- 点击时间切换时间显示格式
Expand Down
9 changes: 5 additions & 4 deletions src/components/RecordPanel/RecordPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from "@/utils/bufferConvert";
import { refThrottled, useScroll } from "@vueuse/core";
import { format } from "date-fns";
import { ref, watch } from "vue";
import { computed, ref, watch } from "vue";
const { records, readingRecord, pinBottom } = useRecordStore();
const rootEl = ref(null);
Expand All @@ -25,10 +25,11 @@ async function toggoleRecordDisplay(record) {
record.display = "hex";
}
}
const recordLength = computed(() => records.value.length);
watch(
[records, refThrottled(readingRecord, 150)],
() => {
if (pinBottom.value) {
[recordLength, refThrottled(readingRecord, 150)],
(value, oldValue) => {
if (pinBottom.value & (value[0] != oldValue[0])) {
setTimeout(() => scrollToBottom(), 0);
}
},
Expand Down

0 comments on commit 6f2dc01

Please sign in to comment.