Skip to content

Commit

Permalink
fix:修复拖拽未展开文件夹后,点击展开无内容的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
FleyX committed Feb 13, 2020
1 parent 323fdbe commit 295f1f8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions front/src/util/cacheUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,17 @@ export async function moveNode(info) {
if (body.sourcePath !== body.targetPath) {
let keys = Object.keys(data);
//旧路径
let oldPath = body.sourcePath + current.bookmarkId;
let oldPath = body.sourcePath + "." + current.bookmarkId;
//新路径
let newPath = body.targetPath + current.bookmarkId;
let newPath = body.targetPath + "." + current.bookmarkId;
keys.forEach(item => {
if (!item.startsWith(oldPath)) {
return;
}
let newPathStr = item.replace(oldPath, newPath);
let list = data[item];
delete data[item];
data[newPathStr] = list;
list.forEach(item1 => (item1.path = newPathStr));
});
}
Expand Down

0 comments on commit 295f1f8

Please sign in to comment.