消毒机设备
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

  1. import { useSystemStore } from 'stores/systemStore'
  2. import { ref } from 'vue'
  3. export const useActivateDebug = () => {
  4. const systemStore = useSystemStore()
  5. const logoClickCount = ref(0)
  6. let clickTimeout: NodeJS.Timeout | null = null
  7. const handleLogoClick = () => {
  8. if (clickTimeout) {
  9. clearTimeout(clickTimeout)
  10. }
  11. logoClickCount.value++
  12. if (logoClickCount.value === 10) {
  13. systemStore.updateDebug()
  14. logoClickCount.value = 0 // 重置计数器
  15. }
  16. clickTimeout = setTimeout(() => {
  17. logoClickCount.value = 0 // 重置计数器
  18. }, 1000)
  19. }
  20. return {
  21. handleLogoClick,
  22. }
  23. }