update: 升级前端核心依赖并完成适配
- 升级 Vue、Vue Router、Element Plus、Vite、UnoCSS、Sass、vue-tsc、oxlint 等前端核心依赖 - 适配依赖升级后的类型检查、键盘事件和 Sass 命名空间写法 - 登录记住功能仅保存用户名和 rememberMe,不再保存密码 - 移除模板中的 scope.row 类型断言,改由处理函数使用 Partial<VO> 承接
This commit is contained in:
@@ -16,9 +16,7 @@
|
||||
clearable
|
||||
placeholder="菜单搜索,支持标题、URL模糊查询"
|
||||
@input="querySearch"
|
||||
@keydown.up.prevent="navigateResult('up')"
|
||||
@keydown.down.prevent="navigateResult('down')"
|
||||
@keydown.enter.prevent="selectActiveResult"
|
||||
@keydown="handleSearchKeydown"
|
||||
>
|
||||
<template #prefix>
|
||||
<svg-icon class-name="search-icon" icon-class="search" />
|
||||
@@ -215,6 +213,23 @@ const navigateResult = (direction: 'up' | 'down') => {
|
||||
state.activeIndex = state.activeIndex >= state.options.length - 1 ? 0 : state.activeIndex + 1;
|
||||
};
|
||||
|
||||
const handleSearchKeydown = (event: KeyboardEvent) => {
|
||||
if (event.key === 'ArrowUp') {
|
||||
event.preventDefault();
|
||||
navigateResult('up');
|
||||
return;
|
||||
}
|
||||
if (event.key === 'ArrowDown') {
|
||||
event.preventDefault();
|
||||
navigateResult('down');
|
||||
return;
|
||||
}
|
||||
if (event.key === 'Enter') {
|
||||
event.preventDefault();
|
||||
selectActiveResult();
|
||||
}
|
||||
};
|
||||
|
||||
const selectActiveResult = () => {
|
||||
if (state.options.length === 0) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user