mirror of
https://gitee.com/energye/energy.git
synced 2024-12-12 12:25:23 +08:00
upgrade-dev v2.3.41
This commit is contained in:
parent
b3c4d72b23
commit
7e3d6d14a1
@ -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())
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user