diff --git a/cef/bind/v8-bind.go b/cef/bind/v8-bind.go index 6bb6bb12..1da98eee 100644 --- a/cef/bind/v8-bind.go +++ b/cef/bind/v8-bind.go @@ -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()) diff --git a/cef/bind/v8-js-array.go b/cef/bind/v8-js-array.go index 0a4135aa..41bbcf88 100644 --- a/cef/bind/v8-js-array.go +++ b/cef/bind/v8-js-array.go @@ -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 }