diff --git a/src/pages/00_manual/ViewPage.vue b/src/pages/00_manual/ViewPage.vue index 6973b6a5..1347efa0 100644 --- a/src/pages/00_manual/ViewPage.vue +++ b/src/pages/00_manual/ViewPage.vue @@ -25,13 +25,13 @@ const md = new MarkdownIt() .use(mditHighlight, { hljs }) .use(mditFigureWithPCaption, { figcaption: 'alt' }); +const wrapper = ref(); const category = ref(''); const page = ref(''); const content = ref(''); const contentParsed = ref>(); const active = ref(''); const toc = ref(true); -const ts = ref(Date.now()); onMounted(async () => { if (typeof ROUTE.params['category'] === 'string') { @@ -93,19 +93,23 @@ async function scrollTo(id: string) { await nextTick(() => { if (window.innerWidth < 1024) toc.value = false; }); - if (pos) - window.scrollTo({ + if (pos) { + wrapper.value?.scrollTo({ top: pos, behavior: 'smooth', }); + } }