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 @@ ...@@ -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();
} }
......
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