mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-06-19 06:42:00 +08:00
fix: prevent default browser action for ctrl + k key combination in RouterSearch component
- 阻止 RouterSearch 组件中 ctrl + k 组合键的默认浏览器操作
This commit is contained in:
parent
8362665f2b
commit
413721bdfd
@ -98,6 +98,8 @@ onUnmounted(() => {
|
||||
// 监听 ctrl + k
|
||||
function listenKey(event) {
|
||||
if ((event.ctrlKey || event.metaKey) && event.key === 'k') {
|
||||
// 阻止触发浏览器默认事件
|
||||
event.preventDefault()
|
||||
showSearch.value = !showSearch.value
|
||||
// 这里可以执行相应的操作(例如打开搜索框等)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user