Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
b06a7ab7
Commit
b06a7ab7
authored
Jul 15, 2021
by
无木
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(basic-tree): `checkedKeys` not worked with `search`
修复搜索功能可能导致`checkedKeys`丢失的问题 fixed: #915
parent
1b3058f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
5 deletions
+25
-5
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+5
-4
Tree.vue
src/components/Tree/src/Tree.vue
+20
-1
No files found.
CHANGELOG.zh_CN.md
View file @
b06a7ab7
...
...
@@ -8,15 +8,15 @@
### 🐛 Bug Fixes
-
**Table**
-
修复滚动条样式问题
-
**
Basic
Table**
-
修复滚动条样式问题
(移除了滚动样式补丁)
-
修复树形表格的带有展开图标的单元格的内容对齐问题
-
新增
`headerTop`
插槽
-
修复操作列的按钮在 disabled 状态下的颜色显示
-
**AppSearch**
修复可能会搜索隐藏菜单的问题
-
**TableAction**
-
仅在
action.tooltip 存在的情况下 才包裹
Tooltip 组件
-
仅在
`action.tooltip`
存在的情况下 才创建
Tooltip 组件
-
修复组件内的圆形按钮内容没有居中的问题
-
**AppSearch**
修复可能会搜索隐藏菜单的问题
-
**BasicUpload**
修复处理非
`array`
值时报错的问题
-
**Form**
修复
`FormItem`
的
`suffix`
插槽样式问题
-
**Menu**
...
...
@@ -27,6 +27,7 @@
-
**Markdown**
修复初始化异常以及不能正确地动态设置 value 的问题
-
**Modal**
确保 props 正确被传递
-
**MultipleTab**
修复可能会意外创建登录路由标签的问题
-
**BasicTree**
修复搜索功能可能导致
`checkedKeys`
丢失的问题
-
**其它**
-
修复菜单默认折叠的配置不起作用的问题
-
修复
`safari`
浏览器报错导致网站打不开
...
...
src/components/Tree/src/Tree.vue
View file @
b06a7ab7
...
...
@@ -18,7 +18,7 @@
import
TreeHeader
from
'
./TreeHeader.vue
'
;
import
{
ScrollContainer
}
from
'
/@/components/Container
'
;
import
{
omit
,
get
}
from
'
lodash-es
'
;
import
{
omit
,
get
,
cloneDeep
,
concat
,
uniq
}
from
'
lodash-es
'
;
import
{
isBoolean
,
isFunction
}
from
'
/@/utils/is
'
;
import
{
extendSlots
,
getSlot
}
from
'
/@/utils/helper/tsxHelper
'
;
import
{
filter
}
from
'
/@/utils/helper/treeHelper
'
;
...
...
@@ -56,6 +56,25 @@
searchData
:
[]
as
TreeItem
[],
});
const
copyState
=
{
checkedKeys
:
[],
};
watch
(
()
=>
searchState
.
startSearch
,
(
newVal
,
oldVal
)
=>
{
if
(
newVal
&&
!
oldVal
)
{
// before search, save current checkedKeys
copyState
.
checkedKeys
=
cloneDeep
(
state
.
checkedKeys
);
}
else
if
(
!
newVal
&&
oldVal
)
{
// after search, restore checkedKeys
state
.
checkedKeys
=
uniq
(
concat
(
state
.
checkedKeys
,
copyState
.
checkedKeys
));
copyState
.
checkedKeys
=
[];
}
},
{
immediate
:
true
}
);
const
treeDataRef
=
ref
<
TreeItem
[]
>
([]);
const
[
createContextMenu
]
=
useContextMenu
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment