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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leisure-core",
3
- "version": "0.6.54",
3
+ "version": "0.6.55",
4
4
  "description": "leisure-core是京心数据基于vue2.x开发的一套后台管理系统桌面端组件库,封装了大量实用的UI控件模板,非常方便开发者快速搭建前端应用",
5
5
  "private": false,
6
6
  "author": "北方乐逍遥(zcx7878)",