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