Browse Source

修改计数器

yangc 7 years ago
parent
commit
70bad00e76
2 changed files with 4 additions and 4 deletions
  1. 3 3
      components/home/displayCard.vue
  2. 1 1
      components/mobile/common/StatisticsMobile.vue

+ 3 - 3
components/home/displayCard.vue

@@ -138,7 +138,7 @@
             }
           }
         }
-        return num
+        return num || 0
       },
       formatDouble (num) {
         if (num) {
@@ -154,8 +154,8 @@
             num += ''
           }
         }
-        return num
-      },
+        return num || 0
+      }
     },
     computed: {
       counter () {

+ 1 - 1
components/mobile/common/StatisticsMobile.vue

@@ -109,7 +109,7 @@
         }
       },
       formatNumber (num, type) {
-        if (num === '' || !num) return false
+        if (num === '' || !num) return 0
         if (num.toString().indexOf('E') !== -1) {
           let arr = num.toString().split('E')
           num = arr[0] * Math.pow(10, arr[1])