fix(components): 修复搜索回车不关闭弹框、点击无法跳转的问题

This commit is contained in:
Azir 2024-06-01 23:49:09 +08:00
parent 2aa85c6f93
commit 752ac32b8a
3 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,7 @@ const DEFAULT_CLASS = 'h-[36px] text-icon';
<template>
<NTooltip :placement="tooltipPlacement" :z-index="zIndex" :disabled="!tooltipContent">
<template #trigger>
<NButton quaternary :class="twMerge(DEFAULT_CLASS, props.class)" v-bind="$attrs">
<NButton quaternary :class="twMerge(DEFAULT_CLASS, props.class)" v-bind="$attrs" :focusable="false">
<div class="flex-center gap-8px">
<slot>
<SvgIcon :icon="icon" />

View File

@ -112,7 +112,7 @@ registerShortcut();
<div class="mt-20px">
<NEmpty v-if="resultOptions.length === 0" :description="$t('common.noData')" />
<SearchResult v-else v-model:path="activePath" :options="resultOptions" @enter.prevent="handleEnter" />
<SearchResult v-else v-model:path="activePath" :options="resultOptions" @enter="handleEnter" />
</div>
<template #footer>
<SearchFooter v-if="!isMobile" />

View File

@ -39,7 +39,7 @@ function handleTo() {
background: item.routePath === active ? theme.themeColor : '',
color: item.routePath === active ? '#fff' : ''
}"
@click="handleTo"
@click.prevent="handleTo"
@mouseenter="handleMouseEnter(item)"
>
<component :is="item.icon" />