This commit is contained in:
Vanessa 2022-05-28 22:43:27 +08:00
parent 410251677c
commit 4837f35487
5 changed files with 23 additions and 18 deletions

View file

@ -226,22 +226,14 @@ data-def-path="${item.defPath}">
});
}
public collapseAll(isFirst = false) {
public collapseAll() {
this.element.querySelectorAll("ul").forEach(item => {
if (!item.classList.contains("b3-list")) {
if (isFirst && item.parentElement.classList.contains("b3-list")) {
// 第一层级不进行缩放
} else {
item.classList.add("fn__none");
}
item.classList.add("fn__none");
}
});
this.element.querySelectorAll(".b3-list-item__arrow").forEach(item => {
if (isFirst && item.parentElement.parentElement.parentElement.classList.contains("b3-list")) {
// 第一层级不进行缩放
} else {
item.classList.remove("b3-list-item__arrow--open");
}
item.classList.remove("b3-list-item__arrow--open");
});
}