chore(docs): move analytics to mounted hook
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import type { Theme } from 'vitepress'
|
import type { Theme } from 'vitepress'
|
||||||
import VueAnimXyz from '@animxyz/vue3'
|
import VueAnimXyz from '@animxyz/vue3'
|
||||||
import DefaultTheme from 'vitepress/theme'
|
import DefaultTheme from 'vitepress/theme'
|
||||||
import { webVitals } from '../plugins/vercel-web-vitals-api'
|
|
||||||
import Layout from './layouts/default.vue'
|
import Layout from './layouts/default.vue'
|
||||||
import 'virtual:windi.css'
|
import 'virtual:windi.css'
|
||||||
import '@animxyz/core'
|
import '@animxyz/core'
|
||||||
@@ -14,7 +13,6 @@ const CustomTheme = {
|
|||||||
Layout,
|
Layout,
|
||||||
enhanceApp: ({ app }) => {
|
enhanceApp: ({ app }) => {
|
||||||
app.use(VueAnimXyz)
|
app.use(VueAnimXyz)
|
||||||
webVitals({ analyticsId: '__ANALYTICS_ID__', debug: false })
|
|
||||||
},
|
},
|
||||||
} as Theme
|
} as Theme
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import DefaultTheme from 'vitepress/theme'
|
import DefaultTheme from 'vitepress/theme'
|
||||||
|
import { webVitals } from '../../plugins/vercel-web-vitals-api'
|
||||||
|
|
||||||
const { Layout: ParentLayout } = DefaultTheme
|
const { Layout: ParentLayout } = DefaultTheme
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
webVitals({ analyticsId: '__ANALYTICS_ID__', debug: false })
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
Reference in New Issue
Block a user