leisure-core 0.6.54 → 0.6.55
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.
|
@@ -152,6 +152,10 @@ export default {
|
|
|
152
152
|
|
|
153
153
|
watch: {
|
|
154
154
|
value(newVal) {
|
|
155
|
+
// let cleaned = newVal;
|
|
156
|
+
// if (this.amount && !this.allowDecimal && cleaned) {
|
|
157
|
+
// cleaned = String(cleaned).replace(/\./g, "");
|
|
158
|
+
// }
|
|
155
159
|
this.internalValue = newVal;
|
|
156
160
|
},
|
|
157
161
|
|
|
@@ -237,6 +241,11 @@ export default {
|
|
|
237
241
|
// 金额输入过滤:只允许数字和小数点
|
|
238
242
|
let filteredValue = value.replace(/[^\d.]/g, "");
|
|
239
243
|
|
|
244
|
+
// 如果禁止小数,则删除所有小数点
|
|
245
|
+
if (!this.allowDecimal) {
|
|
246
|
+
return filteredValue.replace(/\./g, "");
|
|
247
|
+
}
|
|
248
|
+
|
|
240
249
|
// 处理多个小数点的情况
|
|
241
250
|
const parts = filteredValue.split(".");
|
|
242
251
|
if (parts.length > 2) {
|