diff --git a/src/App.vue b/src/App.vue index 7294c44..6899273 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,6 +11,21 @@ import { ElConfigProvider } from "element-plus"; import { ReDialog } from "@/components/ReDialog"; import zhCn from "element-plus/es/locale/lang/zh-cn"; +let OriginTitile = document.title; +let titleTime; +document.addEventListener("visibilitychange", () => { + if (document.hidden) { + OriginTitile = document.title; + document.title = "我才不是柚子厨呢"; + clearTimeout(titleTime); + } else { + document.title = "Ciallo~(∠・ω< )⌒☆"; + titleTime = setTimeout(() => { + document.title = OriginTitile; + }, 2000); + } +}); + export default defineComponent({ name: "app", components: {