xianniu-ui 0.9.11 → 0.9.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xianniu-ui",
3
- "version": "0.9.11",
3
+ "version": "0.9.12",
4
4
  "private": false,
5
5
  "main": "lib/xianniu-ui.umd.min.js",
6
6
  "scripts": {
@@ -10,7 +10,7 @@
10
10
  </i><!--
11
11
  --><slot>{{
12
12
  formatValue
13
- | doPrecision(legalPrecision, isRoundUp)
13
+ | doPrecision(legalPrecision, isRoundUp, emptyValue)
14
14
  | doFormat(hasSeparator, separator)
15
15
  }}</slot><!--
16
16
  --><i
@@ -22,7 +22,7 @@
22
22
  </i>
23
23
  </template>
24
24
  <template v-else>
25
- {{ formatValue | doPrecision(4, isRoundUp) | doCapital }}
25
+ {{ formatValue | doPrecision(4, isRoundUp, emptyValue) | doCapital }}
26
26
  </template>
27
27
  </span>
28
28
  </template>
@@ -100,10 +100,10 @@ export default {
100
100
  },
101
101
  filters: {
102
102
  // 处理精度
103
- doPrecision(value, precision, isRoundUp) {
103
+ doPrecision(value, precision, isRoundUp, emptyValue = '--') {
104
104
  // 处理空值情况
105
105
  if (value == null || isNaN(value)) {
106
- return this.emptyValue;
106
+ return emptyValue;
107
107
  }
108
108
 
109
109
  const exponentialForm = Number(`${value}e${precision}`);