chore(docs): move analytics to mounted hook

This commit is contained in:
braks
2022-11-14 22:19:37 +01:00
parent 118d064c18
commit f1b225078d
2 changed files with 5 additions and 2 deletions
-2
View File
@@ -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>