chore: optional chaining (#8283)

This commit is contained in:
neverland
2021-03-05 11:05:27 +08:00
committed by GitHub
parent 391ccd4240
commit 09e1eb5a0d
7 changed files with 24 additions and 47 deletions
+4 -4
View File
@@ -39,8 +39,8 @@ export default createComponent({
return;
}
const currentName = computed(() => props.name ?? index.value);
const expanded = computed(() => parent.isExpanded(currentName.value));
const name = computed(() => props.name ?? index.value);
const expanded = computed(() => parent.isExpanded(name.value));
const show = ref(expanded.value);
const lazyRender = useLazyRender(show);
@@ -86,8 +86,8 @@ export default createComponent({
});
});
const toggle = (value = !expanded.value) => {
parent.toggle(currentName.value, value);
const toggle = (newValue = !expanded.value) => {
parent.toggle(name.value, newValue);
};
const onClickTitle = () => {