Commit d1e0f981 authored by Sam Hulick's avatar Sam Hulick Committed by hetech

Tabs: Fixed issue where Promise rejection was hitting application (#14816)

parent 9ac51576
......@@ -92,11 +92,14 @@
if (this.currentName !== value && this.beforeLeave) {
const before = this.beforeLeave(value, this.currentName);
if (before && before.then) {
before.then(() => {
changeCurrentName();
this.$refs.nav && this.$refs.nav.removeFocus();
});
before
.then(() => {
changeCurrentName();
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) {
changeCurrentName();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment