提交 37928b42 编写于 作者: DCloud_iOS_WZT's avatar DCloud_iOS_WZT

get-window-info 示例展示优化

上级 6dca70bc
...@@ -43,16 +43,24 @@ ...@@ -43,16 +43,24 @@
// 获取状态栏+导航栏高度, 供截图对比使用 // 获取状态栏+导航栏高度, 供截图对比使用
setStatusBarHeight(res.statusBarHeight); setStatusBarHeight(res.statusBarHeight);
this.items = [] as Item[]; this.items = [] as Item[];
for (const key in res) {
const res_str = JSON.stringify(res);
const res_obj = JSON.parseObject(res_str);
const res_map = res_obj!.toMap();
let keys = [] as string[]
res_map.forEach((_, key) => {
keys.push(key);
});
keys.sort().forEach( key => {
const value = res[key]; const value = res[key];
if (value != null) { if(value != null){
const item = { const item = {
label: key, label: key,
value: "" + ((typeof value == "object") ? JSON.stringify(value) : value) value: "" + ((typeof value == "object")? JSON.stringify(value) : value)
} as Item; } as Item;
this.items.push(item); this.items.push(item);
} }
} });
}, },
//自动化测试例专用 //自动化测试例专用
jest_getWindowInfo() : GetWindowInfoResult { jest_getWindowInfo() : GetWindowInfoResult {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册