File tree 13 files changed +117
-219
lines changed
13 files changed +117
-219
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,11 @@ useHead({
6
6
titleTemplate: ' %s - Helltraitor' ,
7
7
})
8
8
9
- useNuxtApp ().$anchorScroll = {
9
+ useNuxtApp ().$anchorScroll ! . defaults . toAnchor = () => ( {
10
10
behavior: ' smooth' ,
11
11
// headerHeight + 20%
12
- offsetTop: computed (() => - toValue (useNuxtApp ().$headerHeight ?? 0 ) * 1.2 ) ,
13
- }
12
+ offsetTop: - toValue (useNuxtApp ().$headerHeight ?? 0 ) * 1.2 ,
13
+ })
14
14
</script >
15
15
16
16
<template >
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const ANCHOR_LINK_LEVEL = 1
12
12
const { depth : anchorDepth, exclude : anchorExcluded } = runtimeConfig .public .content .anchorLinks
13
13
const anchorLinkEnabled = ANCHOR_LINK_LEVEL <= anchorDepth && ! anchorExcluded .includes (ANCHOR_LINK_LEVEL )
14
14
15
- const { scrollToAnchor } = useAnchorScroll (useNuxtApp (). $anchorScroll )
15
+ const { scrollToAnchor } = useAnchorScroll ()
16
16
</script >
17
17
18
18
<template >
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const ANCHOR_LINK_LEVEL = 2
12
12
const { depth : anchorDepth, exclude : anchorExcluded } = runtimeConfig .public .content .anchorLinks
13
13
const anchorLinkEnabled = ANCHOR_LINK_LEVEL <= anchorDepth && ! anchorExcluded .includes (ANCHOR_LINK_LEVEL )
14
14
15
- const { scrollToAnchor } = useAnchorScroll (useNuxtApp (). $anchorScroll )
15
+ const { scrollToAnchor } = useAnchorScroll ()
16
16
</script >
17
17
18
18
<template >
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const ANCHOR_LINK_LEVEL = 3
12
12
const { depth : anchorDepth, exclude : anchorExcluded } = runtimeConfig .public .content .anchorLinks
13
13
const anchorLinkEnabled = ANCHOR_LINK_LEVEL <= anchorDepth && ! anchorExcluded .includes (ANCHOR_LINK_LEVEL )
14
14
15
- const { scrollToAnchor } = useAnchorScroll (useNuxtApp (). $anchorScroll )
15
+ const { scrollToAnchor } = useAnchorScroll ()
16
16
</script >
17
17
18
18
<template >
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const ANCHOR_LINK_LEVEL = 4
12
12
const { depth : anchorDepth, exclude : anchorExcluded } = runtimeConfig .public .content .anchorLinks
13
13
const anchorLinkEnabled = ANCHOR_LINK_LEVEL <= anchorDepth && ! anchorExcluded .includes (ANCHOR_LINK_LEVEL )
14
14
15
- const { scrollToAnchor } = useAnchorScroll (useNuxtApp (). $anchorScroll )
15
+ const { scrollToAnchor } = useAnchorScroll ()
16
16
</script >
17
17
18
18
<template >
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const ANCHOR_LINK_LEVEL = 5
12
12
const { depth : anchorDepth, exclude : anchorExcluded } = runtimeConfig .public .content .anchorLinks
13
13
const anchorLinkEnabled = ANCHOR_LINK_LEVEL <= anchorDepth && ! anchorExcluded .includes (ANCHOR_LINK_LEVEL )
14
14
15
- const { scrollToAnchor } = useAnchorScroll (useNuxtApp (). $anchorScroll )
15
+ const { scrollToAnchor } = useAnchorScroll ()
16
16
</script >
17
17
18
18
<template >
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const ANCHOR_LINK_LEVEL = 6
12
12
const { depth : anchorDepth, exclude : anchorExcluded } = runtimeConfig .public .content .anchorLinks
13
13
const anchorLinkEnabled = ANCHOR_LINK_LEVEL <= anchorDepth && ! anchorExcluded .includes (ANCHOR_LINK_LEVEL )
14
14
15
- const { scrollToAnchor } = useAnchorScroll (useNuxtApp (). $anchorScroll )
15
+ const { scrollToAnchor } = useAnchorScroll ()
16
16
</script >
17
17
18
18
<template >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export default defineNuxtConfig({
22
22
'@nuxt/content' ,
23
23
'@unocss/nuxt' ,
24
24
'@vueuse/nuxt' ,
25
+ 'nuxt-anchorscroll' ,
25
26
] ,
26
27
runtimeConfig : {
27
28
public : {
Original file line number Diff line number Diff line change 23
23
"@vueuse/nuxt" : " ^10.2.1" ,
24
24
"eslint" : " ^8.43.0" ,
25
25
"nuxt" : " ^3.6.0" ,
26
+ "nuxt-anchorscroll" : " ^1.0.0" ,
26
27
"nuxt-content-assets" : " ^1.3.2" ,
27
28
"remark-heading-id" : " ^1.0.0" ,
28
29
"sass" : " ^1.63.6" ,
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments