mirror of https://github.com/ElemeFE/element
Tree & Breadcrumb: fix setAttribute to undefined bug
parent
f24aeeca00
commit
ed511e9219
|
@ -26,7 +26,9 @@
|
|||
|
||||
mounted() {
|
||||
const items = this.$el.querySelectorAll('.el-breadcrumb__item');
|
||||
items[items.length - 1].setAttribute('aria-current', 'page');
|
||||
if (items.length) {
|
||||
items[items.length - 1].setAttribute('aria-current', 'page');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -194,7 +194,7 @@
|
|||
checkedItem[0].setAttribute('tabindex', 0);
|
||||
return;
|
||||
}
|
||||
this.treeItems[0].setAttribute('tabindex', 0);
|
||||
this.treeItems[0] && this.treeItems[0].setAttribute('tabindex', 0);
|
||||
},
|
||||
handelKeydown(ev) {
|
||||
const currentItem = ev.target;
|
||||
|
|
Loading…
Reference in New Issue