Ver Fonte

[stdf]更新版本至1.0.5

dufu1991 há 1 ano atrás
pai
commit
2619f239e4

+ 1 - 1
packages/stdf/package.json

@@ -1,6 +1,6 @@
 {
 	"name": "stdf",
-	"version": "1.0.4",
+	"version": "1.0.5",
 	"description": "Mobile web component library based on Svelte and Tailwind",
 	"author": "any-tdf",
 	"funding": "https://stdf.design?fund",

+ 3 - 0
packages/stdf/src/lib/components/input/Input.svelte

@@ -200,8 +200,11 @@
 								.replace(/\.{2,}/g, '.')
 								.replace(/^(\d*\.\d*)\./, '$1');
 					} else {
+						// 不允许小数点开头且只允许一个小数点
+						// Do not allow decimal points to start and only allow one decimal point
 						value = e.value
 							.replace(/[^\d.]+/g, '')
+							.replace(/^\./, '')
 							.replace(/\.{2,}/g, '.')
 							.replace(/^(\d*\.\d*)\./, '$1');
 					}