Browse Source

feat(handsontable): 添加zeroFormat设置

zhangweicheng 5 năm trước cách đây
mục cha
commit
1630421d70

+ 1 - 1
handsontable/package.json

@@ -10,7 +10,7 @@
     "url": "https://github.com/handsontable/handsontable/issues"
   },
   "author": "Handsoncode <hello@handsontable.com>",
-  "version": "6.3.0",
+  "version": "6.3.1",
   "browser": "dist/handsontable.js",
   "main": "commonjs/index.js",
   "module": "es/index.js",

+ 5 - 1
handsontable/src/renderers/numericRenderer.js

@@ -24,7 +24,11 @@ function numericRenderer(instance, TD, row, col, prop, value, cellProperties) {
     const cellFormatPattern = numericFormat && numericFormat.pattern;
     const className = cellProperties.className || '';
     const classArr = className.length ? className.split(' ') : [];
-
+    if (numericFormat && numericFormat.zeroFormat !== undefined) {
+      numbro.zeroFormat(numericFormat.zeroFormat);
+    } else {
+      numbro.zeroFormat(null);
+    }
     if (typeof cellCulture !== 'undefined' && !numbro.languages()[cellCulture]) {
       const shortTag = cellCulture.replace('-', '');
       const langData = numbro.allLanguages ? numbro.allLanguages[cellCulture] : numbro[shortTag];