提交 736c67ef 编写于 作者: taohebin@dcloud.io's avatar taohebin@dcloud.io

fix: forin 改为forEach

上级 7bb78cc4
......@@ -27,7 +27,7 @@
detail: string,
}
export default {
data() {
return {
......@@ -55,20 +55,19 @@
const items = [] as Item[];
const jsonArr = JSON.parse<Array<UTSJSONObject>>(content);
if(jsonArr != null){
for(const res in jsonArr){
const json = res as UTSJSONObject;
const title = json["title"] as string;
const subTitle = json["subTitle"] as string;
const img = json["img"] as string;
const detail = json["detail"] as string;
const item:Item = {
title,
subTitle,
img,
detail
}
items.push(item);
}
jsonArr.forEach((json) => {
const title = json["title"] as string;
const subTitle = json["subTitle"] as string;
const img = json["img"] as string;
const detail = json["detail"] as string;
const item:Item = {
title,
subTitle,
img,
detail
}
items.push(item);
})
let temp = [] as Item[];
for(let i = 0; i < 100; i++){
temp = temp.concat(items);
......@@ -80,7 +79,7 @@
},0);
},
complete:function(_){
}
} as ReadFileOptions)
},
......@@ -128,9 +127,9 @@
display: flex;
margin-top: 10rpx;
}
.uni-media-list-text {
color: #9D9D9F;
font-size: 25rpx;
}
</style>
\ No newline at end of file
</style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册