From 7a4e47eb0970dd1cdd496449d97d03253f856d76 Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 14 Jul 2020 20:37:57 +0800 Subject: [PATCH] fix(Tab): should not trigger route when disabled (#6782) --- src/tabs/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tabs/index.js b/src/tabs/index.js index 3123d4b04..9765c0e2f 100644 --- a/src/tabs/index.js +++ b/src/tabs/index.js @@ -267,7 +267,7 @@ export default createComponent({ }, // emit event when clicked - onClick(index) { + onClick(item, index) { const { title, disabled, computedName } = this.children[index]; if (disabled) { this.$emit('disabled', computedName, title); @@ -275,6 +275,7 @@ export default createComponent({ this.setCurrentIndex(index); this.scrollToCurrentContent(); this.$emit('click', computedName, title); + route(item.$router, item); } }, @@ -360,8 +361,7 @@ export default createComponent({ default: () => item.slots('title'), }} onClick={() => { - this.onClick(index); - route(item.$router, item); + this.onClick(item, index); }} /> ));