| | |
| | | <div v-else class="custom-hover" @click.stop="showTopSearch = !showTopSearch"> |
| | | <Icon icon="ep:search" /> |
| | | <el-select |
| | | @click.stop |
| | | filterable |
| | | :reserve-keyword="false" |
| | | remote |
| | |
| | | |
| | | function handleChange(path) { |
| | | router.push({ path }) |
| | | hiddenSearch() |
| | | hiddenTopSearch() |
| | | } |
| | | |
| | | function hiddenSearch() { |
| | | showSearch.value = false |
| | | } |
| | | |
| | | function hiddenTopSearch() { |
| | |
| | | // 监听 ctrl + k |
| | | function listenKey(event) { |
| | | if ((event.ctrlKey || event.metaKey) && event.key === 'k') { |
| | | // 阻止触发浏览器默认事件 |
| | | event.preventDefault() |
| | | showSearch.value = !showSearch.value |
| | | // 这里可以执行相应的操作(例如打开搜索框等) |
| | | } |