You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
634 B
25 lines
634 B
import { useSystemStore } from 'stores/systemStore'
|
|
import { ref } from 'vue'
|
|
|
|
export const useActivateDebug = () => {
|
|
const systemStore = useSystemStore()
|
|
const logoClickCount = ref(0)
|
|
let clickTimeout: NodeJS.Timeout | null = null
|
|
|
|
const handleLogoClick = () => {
|
|
if (clickTimeout) {
|
|
clearTimeout(clickTimeout)
|
|
}
|
|
logoClickCount.value++
|
|
if (logoClickCount.value === 10) {
|
|
systemStore.updateDebug()
|
|
logoClickCount.value = 0 // 重置计数器
|
|
}
|
|
clickTimeout = setTimeout(() => {
|
|
logoClickCount.value = 0 // 重置计数器
|
|
}, 1000)
|
|
}
|
|
return {
|
|
handleLogoClick,
|
|
}
|
|
}
|