From 54dcc40240b34c06767de23525e551ee8e17c2d5 Mon Sep 17 00:00:00 2001
From: daief <1437931235@qq.com>
Date: Sat, 13 Nov 2021 16:40:01 +0800
Subject: [PATCH] fix: wrong domain name
---
docs/src/main.ts | 9 +++++++++
docs/vite.config.ts | 4 +---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/docs/src/main.ts b/docs/src/main.ts
index 8a369ea..a078847 100644
--- a/docs/src/main.ts
+++ b/docs/src/main.ts
@@ -14,5 +14,14 @@ export const createApp = ViteSSG(
app.component('Playground', Playground);
app.component('MarkdownTable', MarkdownTable);
app.use(daisyui as any);
+
+ router.afterEach((to, from) => {
+ if (!isClient) return;
+ if (to.path !== from.path) {
+ try {
+ (window as any).gtag.trackPath(to.path);
+ } catch (error) {}
+ }
+ });
},
);
diff --git a/docs/vite.config.ts b/docs/vite.config.ts
index 2ba0a89..62109a6 100644
--- a/docs/vite.config.ts
+++ b/docs/vite.config.ts
@@ -53,9 +53,7 @@ const config: UserConfig = {
transformIndexHtml: (html) => {
return html.replace(
'',
- isDev
- ? ''
- : '',
+ isDev ? '' : '',
);
},
},