mirror of
https://github.com/DiscordFactory/website-documentation.git
synced 2026-01-14 09:24:23 +01:00
🚧 Work in progress
This commit is contained in:
@@ -155,9 +155,10 @@ import { documentation } from '../utils/Navigation'
|
|||||||
import { CalendarIcon, ChartBarIcon, FolderIcon, HomeIcon, InboxIcon, MenuIcon, UsersIcon, XIcon, MenuAlt2Icon } from '@heroicons/vue/outline'
|
import { CalendarIcon, ChartBarIcon, FolderIcon, HomeIcon, InboxIcon, MenuIcon, UsersIcon, XIcon, MenuAlt2Icon } from '@heroicons/vue/outline'
|
||||||
|
|
||||||
const sidebarOpen = ref(false)
|
const sidebarOpen = ref(false)
|
||||||
|
|
||||||
let toc = ref([])
|
let toc = ref([])
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
window.scroll(0, top + 20)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const elements = document.querySelectorAll('h2, h3')
|
const elements = document.querySelectorAll('h2, h3')
|
||||||
toc.value = Array.from(elements).map((element: HTMLElement) => ({
|
toc.value = Array.from(elements).map((element: HTMLElement) => ({
|
||||||
@@ -166,14 +167,14 @@ onMounted(() => {
|
|||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.replace(/ /g, '-')
|
.replace(/ /g, '-')
|
||||||
}))
|
}))
|
||||||
}, 200)
|
}, 300)
|
||||||
})
|
})
|
||||||
|
|
||||||
function scrollMeTo (refName: string) {
|
function scrollMeTo (refName: string) {
|
||||||
const element = document.getElementById(refName)
|
const element = document.getElementById(refName)
|
||||||
const top = element.offsetTop;
|
const top = element.offsetTop
|
||||||
|
|
||||||
window.scroll(0, top + 20);
|
window.scroll(0, top)
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user