fix: 在组件挂载时自动滚动到顶部以改善用户体验

Co-authored-by: Sylvanysc <Sylvanysc@users.noreply.github.com>
This commit is contained in:
2025-06-03 00:54:42 +08:00
parent f4f7987438
commit 1e7b59e6b0

View File

@@ -48,6 +48,15 @@ onMounted(() => {
nextTick(() => {
mounted.value = true;
});
watchEffect(() => {
if (path.value) {
scrollPanel.value?.$el.firstChild.firstChild.scrollTo({
top: 0,
behavior: "instant",
});
}
});
});
const qrWidth = ref(0);