mirror of
https://github.com/RhenCloud/Cloud-Home.git
synced 2026-01-22 17:39:07 +08:00
- 改进项目页面、网站页面、友链页面 - 从 styles.css 中移除全局样式。 - 添加 tailwind.config.ts 以配置 Tailwind CSS。 - 更新 tsconfig.json,加入 Vue 组件的新路径映射。
30 lines
897 B
TypeScript
30 lines
897 B
TypeScript
import { defineNuxtPlugin } from "#app";
|
|
import { VueUmamiPlugin } from "@jaseeey/vue-umami-plugin";
|
|
import type { Router } from "vue-router";
|
|
import siteConfig from "~/config/siteConfig";
|
|
|
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
if (!process.client) return;
|
|
if (!siteConfig.umami?.enable) return;
|
|
|
|
// 跳过在 localhost 环境下加载 Umami
|
|
if (
|
|
typeof window !== "undefined" &&
|
|
(window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1")
|
|
) {
|
|
console.log("Umami plugin skipped on localhost");
|
|
return;
|
|
}
|
|
|
|
const router = nuxtApp.$router as Router | undefined;
|
|
if (!router) return;
|
|
|
|
nuxtApp.vueApp.use(
|
|
VueUmamiPlugin({
|
|
websiteID: siteConfig.umami.websiteId,
|
|
scriptSrc: siteConfig.umami.url,
|
|
router,
|
|
})
|
|
);
|
|
});
|