15902849627 4 月之前
父節點
當前提交
a2d486fb2e
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/components/page/Dashboard.vue

+ 3 - 3
src/components/page/Dashboard.vue

@@ -532,9 +532,9 @@ export default {
             })
         },
         numberSplit(num) {
-            const targetLength = 5; // 目标数组长度
-            const digits = Array.from(String(num), Number); // [1, 2, 3]
-            const zerosToAdd = targetLength - digits.length; // 需要补的 0 的数量
+            const targetLength = 6; // 目标数组长度
+            const digits = Array.from(String(num.toFixed(0)), Number); // [1, 2, 3]
+            const zerosToAdd =(targetLength > digits.length)? targetLength - digits.length : digits.length; // 需要补的 0 的数量
             const result = Array(zerosToAdd).fill(0).concat(digits);
             return result
         },