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
22 lines
564 B
import { onMounted, ref } from 'vue'
|
|
|
|
onMounted(() => {
|
|
eventListenerKeyboard()
|
|
})
|
|
|
|
const eventListenerKeyboard = (softKeyboardRef?: any) => {
|
|
document.addEventListener('click', (e: any) => {
|
|
if (softKeyboardRef && !e.target?.name) {
|
|
keyboardVisible.value = false
|
|
}
|
|
})
|
|
}
|
|
|
|
const keyboardVisible = ref(false)
|
|
export const openKeyboard = () => {
|
|
// 在焦点内二次点击时不触发EventListener,做一下延迟处理
|
|
console.log('----------1---------')
|
|
setTimeout(() => {
|
|
keyboardVisible.value = !keyboardVisible.value
|
|
}, 100)
|
|
}
|