fix: 修复首页路由和构建错误

This commit is contained in:
jingzhe
2026-07-21 16:48:40 +08:00
parent 4669ee1fb4
commit 4b4f3bad67
8 changed files with 26 additions and 27 deletions

View File

@@ -20,7 +20,6 @@ const particlesContainer = ref<HTMLDivElement | null>(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;
}
}
</style>
</style>

View File

@@ -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)
}
}
}

View File

@@ -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)
}
}
}

View File

@@ -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
export default router

View File

@@ -1,5 +1,4 @@
<script setup lang="ts">
import { images } from '@/assets/images'
import { ref } from 'vue'
@@ -429,4 +428,4 @@ const advantages = [
</div>
</Teleport>
</div>
</template>
</template>

View File

@@ -123,14 +123,9 @@ const testimonials = [
]
const activeTestimonial = ref(0)
const expandedProduct = ref<number | null>(null)
const showProductModal = ref(false)
const selectedProduct = ref<any>(null)
const toggleProduct = (index: number) => {
expandedProduct.value = expandedProduct.value === index ? null : index
}
const openProductDetail = (product: any) => {
selectedProduct.value = product
showProductModal.value = true
@@ -512,4 +507,4 @@ const closeProductDetail = () => {
</div>
</Transition>
</div>
</template>
</template>

View File

@@ -88,11 +88,7 @@ const handleMouseMove = (e: MouseEvent) => {
const enterWebsite = () => {
isEntering.value = true
setTimeout(() => {
<<<<<<< HEAD
router.push('/')
=======
router.push('/home')
>>>>>>> b71fd0336a7a487dac3c305e8fdde42fe63de6f4
}, 1500)
}

View File

@@ -143,7 +143,6 @@ onMounted(() => {
scrollInterval = window.setInterval(() => {
if (!isPaused.value) {
const totalCases = successCases.length
const itemWidth = 100 / 3
const maxScroll = (totalCases / 3) * 100
scrollPosition.value = (scrollPosition.value + scrollSpeed) % maxScroll
}
@@ -407,4 +406,4 @@ const closeCaseDetail = () => {
</div>
</div>
</div>
</template>
</template>