mirror of
https://github.com/fantastic-admin/basic.git
synced 2026-10-07 08:03:43 +08:00
修复全局搜索快速点击会重新显示的bug
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<div id="search" :class="{'searching': isShow}" @click="$eventBus.$emit('global-search-toggle')">
|
||||
<div id="search" :class="{'searching': isShow}" @click="isShow && $eventBus.$emit('global-search-toggle')">
|
||||
<div class="container">
|
||||
<div class="search-box" @click.stop>
|
||||
<el-input ref="input" v-model="search" prefix-icon="el-icon-search" placeholder="搜索页面" clearable @keydown.esc.native="$eventBus.$emit('global-search-toggle')" />
|
||||
<div class="tips">你可以使用快捷键<span>alt</span>+<span>s</span>唤醒搜索面板,按<span>esc</span>退出</div>
|
||||
</div>
|
||||
<div ref="search" class="result">
|
||||
<router-link v-for="item in resultList" :key="item.path" v-slot="{ href, navigate }" :to="item.path">
|
||||
<router-link v-for="item in resultList" :key="item.path" v-slot="{ href, navigate }" :to="isShow ? item.path : ''">
|
||||
<a :href="isExternal(item.path) ? item.path : href" class="item" :target="isExternal(item.path) ? '_blank' : '_self'" @click="navigate">
|
||||
<div class="icon">
|
||||
<svg-icon v-if="item.icon" :name="item.icon" />
|
||||
|
||||
Reference in New Issue
Block a user