mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-06 18:36:55 +08:00
- 在 .editorconfig 中调整文件格式设置,统一代码风格。 - 在 default.d.ts 中为 naive-ui 添加 TabPaneSlots 接口声明,增强类型支持。 - 在多个组件中优化了模板和样式,提升用户交互体验。 - 在 ClientAutoAction.vue 中新增签到设置标签页,丰富功能选项。 - 在 Utils.ts 中增强 GUID 处理逻辑,增加输入验证和错误处理。 - 更新多个组件的逻辑,简化代码结构,提升可读性和维护性。
40 lines
745 B
Vue
40 lines
745 B
Vue
<script setup lang="ts">
|
|
import { TURNSTILE_KEY } from '@/data/constants'
|
|
import { isDarkMode } from '@/Utils';
|
|
import { onUnmounted, ref } from 'vue'
|
|
import { onMounted } from 'vue'
|
|
|
|
import VueTurnstile from 'vue-turnstile'
|
|
const turnstile = ref()
|
|
|
|
const token = defineModel<string>('token', {
|
|
default: '',
|
|
})
|
|
|
|
// Set theme based on dark mode status
|
|
const theme = computed(() => {
|
|
return isDarkMode ? 'dark' : 'light'
|
|
})
|
|
onUnmounted(() => {
|
|
turnstile.value?.remove()
|
|
})
|
|
|
|
defineExpose({
|
|
reset,
|
|
})
|
|
|
|
function reset() {
|
|
turnstile.value?.reset()
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<VueTurnstile
|
|
ref="turnstile"
|
|
v-model="token"
|
|
:site-key="TURNSTILE_KEY"
|
|
:theme="theme"
|
|
style="text-align: center"
|
|
/>
|
|
</template>
|