From 71db7a2284b61bc8b68e1097e9b8ee819cb6f32f Mon Sep 17 00:00:00 2001 From: Jay <csj123456> Date: 星期四, 16 一月 2025 13:47:20 +0800 Subject: [PATCH] 修改指标分类为选择tree,增加选择框可编辑 --- src/components/RouterSearch/index.vue | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/src/components/RouterSearch/index.vue b/src/components/RouterSearch/index.vue index c035242..42a4174 100644 --- a/src/components/RouterSearch/index.vue +++ b/src/components/RouterSearch/index.vue @@ -20,6 +20,7 @@ <div v-else class="custom-hover" @click.stop="showTopSearch = !showTopSearch"> <Icon icon="ep:search" /> <el-select + @click.stop filterable :reserve-keyword="false" remote @@ -78,7 +79,12 @@ function handleChange(path) { router.push({ path }) + hiddenSearch() hiddenTopSearch() +} + +function hiddenSearch() { + showSearch.value = false } function hiddenTopSearch() { @@ -98,6 +104,8 @@ // 监听 ctrl + k function listenKey(event) { if ((event.ctrlKey || event.metaKey) && event.key === 'k') { + // 阻止触发浏览器默认事件 + event.preventDefault() showSearch.value = !showSearch.value // 这里可以执行相应的操作(例如打开搜索框等) } -- Gitblit v1.9.3