From 27a280ab4683d8370a6ce67f45b81205d7a359b8 Mon Sep 17 00:00:00 2001 From: "X1627315083@163.com" <1627315083@qq.com> Date: Mon, 18 May 2026 10:41:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=85=A8=E5=B1=80=E8=A7=86?= =?UTF-8?q?=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 4 +- src/App.vue | 3 ++ src/components/video-model.vue | 74 ++++++++++++++++++++++++++++++++ src/directives/myEvents.ts | 39 +++++++++++++++++ src/pages/about-us/ecosystem.vue | 45 ++++++++++++++++++- src/routes.ts | 3 +- tsconfig.json | 31 ++++++++++--- 7 files changed, 189 insertions(+), 10 deletions(-) create mode 100644 src/components/video-model.vue create mode 100644 src/directives/myEvents.ts diff --git a/index.html b/index.html index 3f3bfb9..3f628a8 100644 --- a/index.html +++ b/index.html @@ -5,10 +5,10 @@ test-ssg - +
- + \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 29423ef..efb5f68 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,6 +3,8 @@ + + \ No newline at end of file diff --git a/src/directives/myEvents.ts b/src/directives/myEvents.ts new file mode 100644 index 0000000..4807386 --- /dev/null +++ b/src/directives/myEvents.ts @@ -0,0 +1,39 @@ + +class MyEvent { + private events: Map void>>; + constructor() { + // 使用 Object 或 Map 存储,实现 O(1) 级别的查找 + this.events = new Map() + } + add(name: string, call: (data: any) => void) { + if (!this.events.has(name)) { + this.events.set(name, []) + } + this.events.get(name)!.push(call) + } + remove(name: string, call?: (data: any) => void) { + if (!this.events.has(name)) return + + if (!call) { + this.events.delete(name) + } else { + const callbacks = this.events.get(name) + const index = callbacks.indexOf(call) + if (index !== -1) { + callbacks.splice(index, 1) + } + // 如果该事件没有监听者了,彻底清理 key + if (callbacks.length === 0) { + this.events.delete(name) + } + } + } + emit(name: string, data?: any) { + const callbacks = this.events.get(name) + if (callbacks) { + // 使用 slice() 镜像一份副本,防止在执行回调过程中有 remove 操作导致索引错乱 + callbacks.slice().forEach((cb) => cb(data)) + } + } +} +export default new MyEvent() diff --git a/src/pages/about-us/ecosystem.vue b/src/pages/about-us/ecosystem.vue index 401fd58..85be8f9 100644 --- a/src/pages/about-us/ecosystem.vue +++ b/src/pages/about-us/ecosystem.vue @@ -1,5 +1,16 @@ @@ -48,6 +61,36 @@ defineExpose({}) max-width: 1200px; margin: 0 auto; padding: 100px 0; + position: relative; + > img{ + width: 100%; + } + > .icon-bofang{ + font-size: 100px; + color: #fff; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); + animation: identifier 2s ease-in-out infinite; + // box-shadow: 0 0 10px #fff; + transition: .3s all; + cursor: pointer; + @keyframes identifier { + 0% { + transform: translate(-50%,-50%) scale(1); + filter: drop-shadow(0px 0px 8px rgba(255, 255, 255, 1)); + } + 50% { + transform: translate(-50%,-50%) scale(.95); + filter: drop-shadow(0px 0px 0px rgba(255, 255, 255, 1)); + } + 100% { + transform: translate(-50%,-50%) scale(1); + filter: drop-shadow(0px 0px 8px rgba(255, 255, 255, 1)); + } + } + } } } diff --git a/src/routes.ts b/src/routes.ts index e84355f..2c9b685 100644 --- a/src/routes.ts +++ b/src/routes.ts @@ -13,7 +13,8 @@ export const routes: RouteRecordRaw[] = [ component: HomeView, }, { - path: 'about', + path: 'about-us', + name: 'about-us', component: AboutView }, { diff --git a/tsconfig.json b/tsconfig.json index 1ffef60..8aa62ea 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,26 @@ { - "files": [], - "references": [ - { "path": "./tsconfig.app.json" }, - { "path": "./tsconfig.node.json" } - ] -} + "files": [], + "include": ["env.d.ts", "src/**/*", "src/**/*.vue", "src/types/**/*.d.ts"], + "compilerOptions": { + "forceConsistentCasingInFileNames": false, // ⚠️ 禁用大小写检查 + "allowJs": true, + "baseUrl": ".", + "types": ["node", "unplugin-vue-define-options/macros-global"], + "paths": { + "@/*": ["./src/*"], + "_c/*": ["./src/components/*"] + }, + "skipLibCheck": true, + "strict": false, + "noEmit": true, + "noImplicitAny": false, + "noEmitOnError": false + }, + + "references": [ + { "path": "./tsconfig.app.json" }, + { + "path": "./tsconfig.node.json" + } + ] + } \ No newline at end of file