diff --git a/pages/index.vue b/pages/index.vue index be5de15..61da5f7 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -60,11 +60,11 @@ import { ref, onMounted, nextTick } from 'vue'; const active = ref(0); onMounted(async () => { - scrollToHashElement(); + scrollToElementByHash(); }); // 根据hash值跳转到指定位置 -async function scrollToHashElement() { +async function scrollToElementByHash() { await nextTick(); const hash = window.location.hash; if (!hash) return;