kmcom-nuxt-layers 1.6.46 → 1.6.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,8 +48,10 @@ export default defineNuxtPlugin(() => {
48
48
  const appConfig = useAppConfig()
49
49
  const smoothScroll: boolean | string[] = appConfig.motion?.smoothScroll ?? true
50
50
 
51
+ const nuxtApp = useNuxtApp()
52
+
51
53
  if (smoothScroll === true) {
52
- init()
54
+ nuxtApp.hook('app:mounted', () => nextTick(init))
53
55
  } else if (Array.isArray(smoothScroll)) {
54
56
  addRouteMiddleware((to, from) => {
55
57
  if (smoothScroll.includes(to.path)) {
@@ -59,7 +61,7 @@ export default defineNuxtPlugin(() => {
59
61
  }
60
62
  })
61
63
  if (smoothScroll.includes(router.currentRoute.value.path)) {
62
- init()
64
+ nuxtApp.hook('app:mounted', () => nextTick(init))
63
65
  }
64
66
  }
65
67
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kmcom-nuxt-layers",
3
3
  "private": false,
4
- "version": "1.6.46",
4
+ "version": "1.6.47",
5
5
  "description": "Composable Nuxt 4 layers for building scalable Vue applications",
6
6
  "exports": {
7
7
  "./layers/core": "./layers/core/nuxt.config.ts",