修复问题

This commit is contained in:
谦君
2026-01-06 03:06:14 +08:00
parent 9e7560cc4b
commit ec96d2541e
2 changed files with 11 additions and 5 deletions

View File

@@ -9,7 +9,7 @@
}, },
"private": true, "private": true,
"version": "1.6.0", "version": "1.6.0",
"buildDate": "2026/1/6 02:54:44", "buildDate": "2026/1/6 03:05:21",
"main": "dist-electron/main.js", "main": "dist-electron/main.js",
"type": "module", "type": "module",
"scripts": { "scripts": {

View File

@@ -71,11 +71,17 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import type { SpringOptions, Transition } from 'motion-v'
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils'
import { motion, useMotionValue, useSpring } from 'motion-v' import { motion, useMotionValue, useSpring } from 'motion-v'
import { computed, onMounted, ref, watch } from 'vue' import { computed, onMounted, ref, watch } from 'vue'
// 本地定义类型,因为 motion-v 不导出这些类型
interface SpringOptions {
stiffness?: number
damping?: number
mass?: number
}
interface StarsBackgroundProps { interface StarsBackgroundProps {
factor?: number factor?: number
speed?: number speed?: number
@@ -139,19 +145,19 @@
} }
) )
const starLayer1Transition = computed<Transition>(() => ({ const starLayer1Transition = computed(() => ({
repeat: Infinity, repeat: Infinity,
duration: props.speed, duration: props.speed,
ease: 'linear' as const ease: 'linear' as const
})) }))
const starLayer2Transition = computed<Transition>(() => ({ const starLayer2Transition = computed(() => ({
repeat: Infinity, repeat: Infinity,
duration: props.speed * 2, duration: props.speed * 2,
ease: 'linear' as const ease: 'linear' as const
})) }))
const starLayer3Transition = computed<Transition>(() => ({ const starLayer3Transition = computed(() => ({
repeat: Infinity, repeat: Infinity,
duration: props.speed * 3, duration: props.speed * 3,
ease: 'linear' as const ease: 'linear' as const