🐛 Fix: [前台]:修复点击搜索项跳转的地址为当前高亮选中的不是当前点击的行

This commit is contained in:
fanxb 2019-07-31 14:39:26 +08:00
parent d22a747173
commit 934d8acfa1

View File

@ -148,7 +148,11 @@ class Search extends React.Component {
{resultList.length > 0 ? (
<div className={styles.resultList}>
{resultList.map((item, index) => (
<div className={`${styles.item} ${index === currentIndex ? styles.checked : ""}`} key={item.bookmarkId} onClick={this.enter.bind(this)}>
<div
className={`${styles.item} ${index === currentIndex ? styles.checked : ""}`}
key={item.bookmarkId}
onClick={() => window.open(item.url)}
>
<span style={{ fontWeight: 600 }}>{item.name}&emsp;</span>
<span style={{ fontSize: "0.8em", fontWeight: 400 }}>{item.url}</span>
</div>