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

View File

@@ -1,7 +1,6 @@
import type { Theme } from 'vitepress'
import VueAnimXyz from '@animxyz/vue3'
import DefaultTheme from 'vitepress/theme'
import { webVitals } from '../plugins/vercel-web-vitals-api'
import Layout from './layouts/default.vue'
import 'virtual:windi.css'
import '@animxyz/core'
@@ -14,7 +13,6 @@ const CustomTheme = {
Layout,
enhanceApp: ({ app }) => {
app.use(VueAnimXyz)
webVitals({ analyticsId: '__ANALYTICS_ID__', debug: false })
},
} as Theme

View File

@@ -1,7 +1,12 @@
<script setup>
import DefaultTheme from 'vitepress/theme'
import { webVitals } from '../../plugins/vercel-web-vitals-api'
const { Layout: ParentLayout } = DefaultTheme
onMounted(() => {
webVitals({ analyticsId: '__ANALYTICS_ID__', debug: false })
})
</script>
<template>