xianniu-ui 0.9.9 → 0.9.11
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/lib/xianniu-ui.common.js +39 -30
- package/lib/xianniu-ui.umd.js +39 -30
- package/lib/xianniu-ui.umd.min.js +2 -2
- package/package.json +1 -1
- package/packages/amount/main.vue +9 -0
package/package.json
CHANGED
package/packages/amount/main.vue
CHANGED
|
@@ -93,10 +93,19 @@ export default {
|
|
|
93
93
|
type: Object,
|
|
94
94
|
default: () => ({}),
|
|
95
95
|
},
|
|
96
|
+
emptyValue: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: "--",
|
|
99
|
+
},
|
|
96
100
|
},
|
|
97
101
|
filters: {
|
|
98
102
|
// 处理精度
|
|
99
103
|
doPrecision(value, precision, isRoundUp) {
|
|
104
|
+
// 处理空值情况
|
|
105
|
+
if (value == null || isNaN(value)) {
|
|
106
|
+
return this.emptyValue;
|
|
107
|
+
}
|
|
108
|
+
|
|
100
109
|
const exponentialForm = Number(`${value}e${precision}`);
|
|
101
110
|
const rounded = isRoundUp
|
|
102
111
|
? Math.round(exponentialForm)
|