Pre Merge pull request !623 from AhJindeg/fix/router-search

pull/623/MERGE
AhJindeg 2024-12-17 08:39:38 +00:00 committed by Gitee
commit 5b4ce181e9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 2 additions and 0 deletions

View File

@ -99,6 +99,8 @@ onUnmounted(() => {
// 监听 ctrl + k
function listenKey(event) {
if ((event.ctrlKey || event.metaKey) && event.key === 'k') {
// 阻止触发浏览器默认事件
event.preventDefault()
showSearch.value = !showSearch.value
// 这里可以执行相应的操作(例如打开搜索框等)
}