Skip to content

Commit

Permalink
feat(projects): 菜单搜索增加大小写转换
Browse files Browse the repository at this point in the history
  • Loading branch information
yanbowe committed Dec 31, 2021
1 parent 078433d commit 2907868
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/layouts/common/GlobalSearch/components/SearchModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ watch(show, async val => {
/** 查询 */
function search() {
resultOptions.value = menusList.filter(menu => keyword.value && menu.meta?.title.includes(keyword.value.trim()));
resultOptions.value = menusList.filter(
menu => keyword.value && menu.meta?.title.toLocaleLowerCase().includes(keyword.value.toLocaleLowerCase().trim())
);
if (resultOptions.value?.length > 0) {
activePath.value = resultOptions.value[0].path;
} else {
Expand All @@ -80,9 +82,12 @@ function search() {
}
function handleClose() {
resultOptions.value = [];
keyword.value = '';
show.value = false;
/** 延时处理防止用户看到某些操作 */
setTimeout(() => {
resultOptions.value = [];
keyword.value = '';
}, 200);
}
/** key up */
Expand Down

0 comments on commit 2907868

Please sign in to comment.