mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-02-01 19:24:58 +08:00
!623 fix: prevent default browser action for ctrl + k key combination in RouterSearch component
Merge pull request !623 from AhJindeg/fix/router-search
This commit is contained in:
commit
25484a941b
@ -99,6 +99,8 @@ onUnmounted(() => {
|
||||
// 监听 ctrl + k
|
||||
function listenKey(event) {
|
||||
if ((event.ctrlKey || event.metaKey) && event.key === 'k') {
|
||||
// 阻止触发浏览器默认事件
|
||||
event.preventDefault()
|
||||
showSearch.value = !showSearch.value
|
||||
// 这里可以执行相应的操作(例如打开搜索框等)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user