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

fix: forin 改为forEach

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