From 4b4f3bad67b1d4ba58104a2b25fd4a05e7fb9206 Mon Sep 17 00:00:00 2001 From: jingzhe Date: Tue, 21 Jul 2026 16:48:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E5=92=8C=E6=9E=84=E5=BB=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CosmicBackground.vue | 3 +-- src/directives/neuralCard.ts | 12 +++++++++--- src/directives/ripple.ts | 16 +++++++++++----- src/router/index.ts | 5 ++--- src/views/About.vue | 3 +-- src/views/Home.vue | 7 +------ src/views/LandingPage.vue | 4 ---- src/views/Solutions.vue | 3 +-- 8 files changed, 26 insertions(+), 27 deletions(-) diff --git a/src/components/CosmicBackground.vue b/src/components/CosmicBackground.vue index b7d28af..af8b08f 100644 --- a/src/components/CosmicBackground.vue +++ b/src/components/CosmicBackground.vue @@ -20,7 +20,6 @@ const particlesContainer = ref(null) const particles: Particle[] = [] const mousePos = { x: 0, y: 0 } let animationFrameId: number | null = null -let time = 0 const nebulaColors = [ '#6366f1', @@ -369,4 +368,4 @@ onUnmounted(() => { background-position: 1000px 600px; } } - \ No newline at end of file + diff --git a/src/directives/neuralCard.ts b/src/directives/neuralCard.ts index a3b76f6..bdb5951 100644 --- a/src/directives/neuralCard.ts +++ b/src/directives/neuralCard.ts @@ -7,8 +7,13 @@ interface ActivatePoint { progress: number } +type NeuralCardElement = HTMLElement & { + _neuralAnimationId?: number | null +} + const vNeuralCard: Directive = { mounted(el: HTMLElement) { + const neuralEl = el as NeuralCardElement const points: ActivatePoint[] = [] let pointId = 0 let animationId: number | null = null @@ -107,12 +112,13 @@ const vNeuralCard: Directive = { animate() - el._neuralAnimationId = animationId + neuralEl._neuralAnimationId = animationId }, unmounted(el: HTMLElement) { - if (el._neuralAnimationId) { - cancelAnimationFrame(el._neuralAnimationId) + const neuralEl = el as NeuralCardElement + if (neuralEl._neuralAnimationId) { + cancelAnimationFrame(neuralEl._neuralAnimationId) } } } diff --git a/src/directives/ripple.ts b/src/directives/ripple.ts index 5168ebd..a153be3 100644 --- a/src/directives/ripple.ts +++ b/src/directives/ripple.ts @@ -1,11 +1,16 @@ -import type { Directive, DirectiveBinding } from 'vue' +import type { Directive } from 'vue' interface RippleEvent extends MouseEvent { _ripple?: HTMLElement } +type RippleElement = HTMLElement & { + _rippleHandler?: (e: MouseEvent) => void +} + const vRipple: Directive = { - mounted(el: HTMLElement, binding: DirectiveBinding) { + mounted(el: HTMLElement) { + const rippleEl = el as RippleElement el.style.position = 'relative' el.style.overflow = 'hidden' @@ -81,12 +86,13 @@ const vRipple: Directive = { } el.addEventListener('click', handleClick) - el._rippleHandler = handleClick + rippleEl._rippleHandler = handleClick }, unmounted(el: HTMLElement) { - if (el._rippleHandler) { - el.removeEventListener('click', el._rippleHandler) + const rippleEl = el as RippleElement + if (rippleEl._rippleHandler) { + el.removeEventListener('click', rippleEl._rippleHandler) } } } diff --git a/src/router/index.ts b/src/router/index.ts index 29c83f8..c7808a4 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -5,8 +5,7 @@ const router = createRouter({ routes: [ { path: '/', - name: 'Landing', - component: () => import('@/views/LandingPage.vue') + redirect: '/home' }, { path: '/home', @@ -50,4 +49,4 @@ const router = createRouter({ } }) -export default router \ No newline at end of file +export default router diff --git a/src/views/About.vue b/src/views/About.vue index e6e03e6..2f5e2eb 100644 --- a/src/views/About.vue +++ b/src/views/About.vue @@ -1,5 +1,4 @@