mirror of https://github.com/ElemeFE/element
Tabs: Fixed issue where Promise rejection was hitting application (#14816)
parent
9ac51576e6
commit
d1e0f9812c
|
@ -92,11 +92,14 @@
|
||||||
if (this.currentName !== value && this.beforeLeave) {
|
if (this.currentName !== value && this.beforeLeave) {
|
||||||
const before = this.beforeLeave(value, this.currentName);
|
const before = this.beforeLeave(value, this.currentName);
|
||||||
if (before && before.then) {
|
if (before && before.then) {
|
||||||
before.then(() => {
|
before
|
||||||
changeCurrentName();
|
.then(() => {
|
||||||
|
changeCurrentName();
|
||||||
this.$refs.nav && this.$refs.nav.removeFocus();
|
this.$refs.nav && this.$refs.nav.removeFocus();
|
||||||
});
|
}, () => {
|
||||||
|
// https://github.com/ElemeFE/element/pull/14816
|
||||||
|
// ignore promise rejection in `before-leave` hook
|
||||||
|
});
|
||||||
} else if (before !== false) {
|
} else if (before !== false) {
|
||||||
changeCurrentName();
|
changeCurrentName();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue