52yaoer
52yaoer
  • 发布:2024-09-26 23:19
  • 更新:2024-09-27 11:00
  • 阅读:189

【报Bug】UTS中遍历UTSJSONObject iOS和安卓效果不一样

分类:MUI

产品分类: 其他/MUI

示例代码:

let utsJsonObj = {
name:"zhangsan",
age:"22",
}
utsJsonObj['classInfo'] = "三年二班"
utsJsonObj.forEach(function(perField:any){
console.log(perField)
})

操作步骤:

let utsJsonObj = {
name: "zhangsan",
age: "22",
bb: null
}
utsJsonObj['classInfo'] = "三年二班"
console.log("%%%%%%%%%%%%%%%");
utsJsonObj.forEach(function (perField : any) {
console.log(perField)
})

预期结果:

23:17:04.692 age at pages/UTSDemo/IjkplayerUTS.uvue:85
23:17:04.693 bb at pages/UTSDemo/IjkplayerUTS.uvue:85
23:17:04.693 name at pages/UTSDemo/IjkplayerUTS.uvue:85
23:17:04.693 classInfo at pages/UTSDemo/IjkplayerUTS.uvue:85

实际结果:

23:17:35.149 zhangsan at pages/UTSDemo/IjkplayerUTS.uvue:85
23:17:35.149 22 at pages/UTSDemo/IjkplayerUTS.uvue:85
23:17:35.149 null at pages/UTSDemo/IjkplayerUTS.uvue:85
23:17:35.149 三年二班 at pages/UTSDemo/IjkplayerUTS.uvue:85

bug描述:

let utsJsonObj = {
name:"zhangsan",
age:"22",
}
utsJsonObj['classInfo'] = "三年二班"
utsJsonObj.forEach(function(perField:any){
console.log(perField)
})

安卓输出结果和iOS输出结果不一致

安卓输出:
23:17:04.692 age at pages/UTSDemo/IjkplayerUTS.uvue:85
23:17:04.693 bb at pages/UTSDemo/IjkplayerUTS.uvue:85
23:17:04.693 name at pages/UTSDemo/IjkplayerUTS.uvue:85
23:17:04.693 classInfo at pages/UTSDemo/IjkplayerUTS.uvue:85

iOS输出:
23:17:35.149 zhangsan at pages/UTSDemo/IjkplayerUTS.uvue:85
23:17:35.149 22 at pages/UTSDemo/IjkplayerUTS.uvue:85
23:17:35.149 null at pages/UTSDemo/IjkplayerUTS.uvue:85
23:17:35.149 三年二班 at pages/UTSDemo/IjkplayerUTS.uvue:85

2024-09-26 23:19 负责人:无 分享
已邀请:
DCloud_Android_DQQ

DCloud_Android_DQQ

bug 已确认

要回复问题请先登录注册