fix: prevent default browser action for ctrl + k key combination in RouterSearch component

- 阻止 RouterSearch 组件中 ctrl + k 组合键的默认浏览器操作
pull/623/head
AhJindeg 2024-12-17 16:30:58 +08:00
parent 8362665f2b
commit 413721bdfd
1 changed files with 2 additions and 0 deletions

View File

@ -98,6 +98,8 @@ onUnmounted(() => {
// ctrl + k
function listenKey(event) {
if ((event.ctrlKey || event.metaKey) && event.key === 'k') {
//
event.preventDefault()
showSearch.value = !showSearch.value
//
}