Browse Source

fix(tabs): change event emit bug #1884

richard1015 2 years ago
parent
commit
d4a3b70499
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/packages/__VUE/tabs/index.taro.vue
  2. 1 1
      src/packages/__VUE/tabs/index.vue

+ 1 - 1
src/packages/__VUE/tabs/index.taro.vue

@@ -297,7 +297,7 @@ export default create({
     const methods = {
       tabChange: (item: Title, index: number) => {
         emit('click', item);
-        if (item.disabled) {
+        if (item.disabled || currentIndex.value == index) {
           return;
         }
         currentIndex.value = index;

+ 1 - 1
src/packages/__VUE/tabs/index.vue

@@ -282,7 +282,7 @@ export default create({
     const methods = {
       tabChange: (item: Title, index: number) => {
         emit('click', item);
-        if (item.disabled) {
+        if (item.disabled || currentIndex.value == index) {
           return;
         }
         currentIndex.value = index;