瀏覽代碼

feat(handsontable): 添加zeroFormat设置

zhangweicheng 5 年之前
父節點
當前提交
1630421d70
共有 2 個文件被更改,包括 6 次插入2 次删除
  1. 1 1
      handsontable/package.json
  2. 5 1
      handsontable/src/renderers/numericRenderer.js

+ 1 - 1
handsontable/package.json

@@ -10,7 +10,7 @@
     "url": "https://github.com/handsontable/handsontable/issues"
     "url": "https://github.com/handsontable/handsontable/issues"
   },
   },
   "author": "Handsoncode <hello@handsontable.com>",
   "author": "Handsoncode <hello@handsontable.com>",
-  "version": "6.3.0",
+  "version": "6.3.1",
   "browser": "dist/handsontable.js",
   "browser": "dist/handsontable.js",
   "main": "commonjs/index.js",
   "main": "commonjs/index.js",
   "module": "es/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 cellFormatPattern = numericFormat && numericFormat.pattern;
     const className = cellProperties.className || '';
     const className = cellProperties.className || '';
     const classArr = className.length ? className.split(' ') : [];
     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]) {
     if (typeof cellCulture !== 'undefined' && !numbro.languages()[cellCulture]) {
       const shortTag = cellCulture.replace('-', '');
       const shortTag = cellCulture.replace('-', '');
       const langData = numbro.allLanguages ? numbro.allLanguages[cellCulture] : numbro[shortTag];
       const langData = numbro.allLanguages ? numbro.allLanguages[cellCulture] : numbro[shortTag];