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

22 lines
564 B

  1. import { onMounted, ref } from 'vue'
  2. onMounted(() => {
  3. eventListenerKeyboard()
  4. })
  5. const eventListenerKeyboard = (softKeyboardRef?: any) => {
  6. document.addEventListener('click', (e: any) => {
  7. if (softKeyboardRef && !e.target?.name) {
  8. keyboardVisible.value = false
  9. }
  10. })
  11. }
  12. const keyboardVisible = ref(false)
  13. export const openKeyboard = () => {
  14. // 在焦点内二次点击时不触发EventListener,做一下延迟处理
  15. console.log('----------1---------')
  16. setTimeout(() => {
  17. keyboardVisible.value = !keyboardVisible.value
  18. }, 100)
  19. }