diff --git a/docs/uts/data-type.md b/docs/uts/data-type.md index c74a7638bbff70b46bb6231030c6bc3e8497a96b..3f8260c3e4b37cf5388bc41b53302b976931579d 100644 --- a/docs/uts/data-type.md +++ b/docs/uts/data-type.md @@ -697,6 +697,14 @@ console.log(listData["count"]); //42 console.log(listArr[0]["title"]); //第一组 ``` +多层级下标访问是需要使用 as 转换为UTSJSONObject +```ts +var j = {"test":{ + "a-b": 1 +}} +console.log((j['test'] as UTSJSONObject)['a-b']); +``` + 3. 通过keyPath访问 类型属性 在`HBuilderX` 3.9.0 之后的版本,UTSJSONObject提供了另外一种属性访问方式