Template
1
0
mirror of https://github.com/un-pany/v3-admin-vite.git synced 2025-04-20 10:59:21 +08:00

perf: 优化 ThemeSwitch 组件细节

This commit is contained in:
pany 2024-11-25 10:19:15 +08:00
parent 30b4754493
commit 61997fd102

View File

@ -14,9 +14,7 @@ function handleChangeTheme({ clientX, clientY }: MouseEvent, themeName: ThemeNam
style.setProperty("--v3-theme-x", `${clientX}px`)
style.setProperty("--v3-theme-y", `${clientY}px`)
style.setProperty("--v3-theme-r", `${maxRadius}px`)
const handler = () => {
setTheme(themeName)
}
const handler = () => setTheme(themeName)
document.startViewTransition ? document.startViewTransition(handler) : handler()
}
</script>