upgrade-dev v2.3.41

This commit is contained in:
杨红岩 2023-03-27 16:29:19 +08:00
parent b3c4d72b23
commit 7e3d6d14a1
2 changed files with 7 additions and 5 deletions

View File

@ -94,6 +94,7 @@ func Test() {
integerKey.SetValue("变成字符串")
fmt.Println("integerKey", integerKey.AsString().Value())
integerKey.SetValue(true)
fmt.Println("integerKey", integerKey.AsBoolean().Value())
boolField := integerKey.AsBoolean()
fmt.Println("boolField", boolField.Value())
fmt.Println("boolField", bind.GetJSValue(boolField.Id()).AsBoolean().Value())

View File

@ -11,12 +11,10 @@
// V8 JSValue JSArray 类型实现
package bind
import "github.com/energye/energy/pkgs/json"
type JSArray interface {
JSValue
AsArray() JSArray
Value() json.JSONArray
Value() any
}
// JSArray 类型 先保留 未添加
@ -31,6 +29,9 @@ func (m *jsArray) AsArray() JSArray {
return nil
}
func (m *jsArray) Value() json.JSONArray {
return m.value.JSONArray()
func (m *jsArray) Value() any {
if m.IsArray() {
return m.value.Data()
}
return nil
}