Skip to content

Commit

Permalink
feat: regExp in search
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingyu521 committed Jul 17, 2024
1 parent 7ab55ae commit aad7323
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/search/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const handleSearch = (e: any) => {
= value.length > 0
? AllLinks.filter(
item =>
item.description.includes(value) || item.title.includes(value),
[item.title, item.description].some(it => new RegExp(value, 'i').test(it)),
)
: []
}
Expand Down Expand Up @@ -83,7 +83,7 @@ watch(meta_k, (isClickMetaK) => {
<input
ref="inputRef"
v-model="searchValue"
placeholder="站内搜索关键词"
placeholder="站内搜索关键词(支持正则)"
class="modal-header__input"
@input="handleSearch"
>
Expand Down

0 comments on commit aad7323

Please sign in to comment.