提交 4b2d85a3 编写于 作者: 杜庆泉's avatar 杜庆泉

Update utsjsonobject.md

上级 59767638
...@@ -214,6 +214,29 @@ console.log(genericArray) ...@@ -214,6 +214,29 @@ console.log(genericArray)
``` ```
### parse<T>(): T | null
<!-- UTSJSON.UTSJSONObject.parse.description -->
<!-- UTSJSON.UTSJSONObject.parse.param -->
<!-- UTSJSON.UTSJSONObject.parse.returnValue -->
<!-- UTSJSON.UTSJSONObject.parse.compatibility -->
```ts
type A = {
x:number,
y:string,
}
let rootObj = JSON.parseObject('{"x":111,"y":"aaa","t":{"name":"zhangsan"}}')
let a = rootObj!.parse<A>()
// UTSJSONObject
console.log(rootObj)
// A
console.log(a)
```
### toMap(): Map<string, any> ### toMap(): Map<string, any>
<!-- UTSJSON.UTSJSONObject.toMap.description --> <!-- UTSJSON.UTSJSONObject.toMap.description -->
...@@ -234,15 +257,7 @@ person.toMap().forEach((value, key) => { ...@@ -234,15 +257,7 @@ person.toMap().forEach((value, key) => {
<!-- UTSJSON.UTSJSONObject.tutorial --> <!-- UTSJSON.UTSJSONObject.tutorial -->
### parse<T>(): T | null
<!-- UTSJSON.UTSJSONObject.parse.description -->
<!-- UTSJSON.UTSJSONObject.parse.param -->
<!-- UTSJSON.UTSJSONObject.parse.returnValue -->
<!-- UTSJSON.UTSJSONObject.parse.compatibility -->
## 注意事项 ## 注意事项
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册