mirror of
https://github.com/cuigh/swirl
synced 2024-12-28 14:51:57 +00:00
Fix bug of Form component
This commit is contained in:
parent
317446e5cd
commit
8ce6adf478
@ -747,16 +747,18 @@ var Swirl;
|
||||
default:
|
||||
entry.value = input.value;
|
||||
}
|
||||
switch (dataType) {
|
||||
case "integer":
|
||||
entry.value = parseInt(entry.value);
|
||||
break;
|
||||
case "float":
|
||||
entry.value = parseFloat(entry.value);
|
||||
break;
|
||||
case "bool":
|
||||
entry.value = (entry.value === "true") || (entry.value === "1");
|
||||
break;
|
||||
if (entry.value != null) {
|
||||
switch (dataType) {
|
||||
case "integer":
|
||||
entry.value = parseInt(entry.value);
|
||||
break;
|
||||
case "float":
|
||||
entry.value = parseFloat(entry.value);
|
||||
break;
|
||||
case "bool":
|
||||
entry.value = (entry.value === "true") || (entry.value === "1");
|
||||
break;
|
||||
}
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -233,16 +233,18 @@ namespace Swirl.Core {
|
||||
entry.value = input.value;
|
||||
}
|
||||
|
||||
switch (dataType) {
|
||||
case "integer":
|
||||
entry.value = parseInt(entry.value);
|
||||
break;
|
||||
case "float":
|
||||
entry.value = parseFloat(entry.value);
|
||||
break;
|
||||
case "bool":
|
||||
entry.value = (entry.value === "true") || (entry.value === "1");
|
||||
break;
|
||||
if (entry.value != null) {
|
||||
switch (dataType) {
|
||||
case "integer":
|
||||
entry.value = parseInt(entry.value);
|
||||
break;
|
||||
case "float":
|
||||
entry.value = parseFloat(entry.value);
|
||||
break;
|
||||
case "bool":
|
||||
entry.value = (entry.value === "true") || (entry.value === "1");
|
||||
break;
|
||||
}
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
@ -16,9 +16,6 @@ var Funcs = map[string]interface{}{
|
||||
// return t.Local().Format("2006-01-02 15:04:05")
|
||||
//},
|
||||
"join": strings.Join,
|
||||
"eq": func(v1, v2 interface{}) bool {
|
||||
return fmt.Sprint(v1) == fmt.Sprint(v2)
|
||||
},
|
||||
"elem": func(i interface{}) interface{} {
|
||||
v := reflect.ValueOf(i)
|
||||
for v.Kind() == reflect.Ptr {
|
||||
|
Loading…
Reference in New Issue
Block a user