mirror of
https://github.com/RhenCloud/Cloud-Home.git
synced 2026-01-22 17:39:07 +08:00
refactor:删除已弃用的组件和样式,迁移到 Tailwind CSS
- 改进项目页面、网站页面、友链页面 - 从 styles.css 中移除全局样式。 - 添加 tailwind.config.ts 以配置 Tailwind CSS。 - 更新 tsconfig.json,加入 Vue 组件的新路径映射。
This commit is contained in:
29
app/plugins/umami.client.ts
Normal file
29
app/plugins/umami.client.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
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,
|
||||
})
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user