fix:issues-2

This commit is contained in:
fanxb 2020-03-29 16:35:09 +08:00
parent 160fa38c52
commit afb9886756

View File

@ -45,8 +45,10 @@ export async function cacheBookmarkData() {
* @param {*} path path
*/
export function getBookmarkList(path) {
let data = window[TREE_LIST_KEY][path];
return data ? data : [];
if (window[TREE_LIST_KEY][path] === undefined) {
window[TREE_LIST_KEY][path] = [];
}
return window[TREE_LIST_KEY][path];
}
/**
@ -83,6 +85,7 @@ export async function updateCurrentChangeTime() {
* @param {*} node
*/
export async function addNode(currentNode, node) {
debugger;
let treeDataMap = window[TREE_LIST_KEY];
if (currentNode) {
let key = currentNode.path + "." + currentNode.bookmarkId;