迴圈遍歷,根據條件給頁面渲染值,layui,jq
阿新 • • 發佈:2021-04-05
迴圈遍歷,根據條件給頁面渲染值
for (var index in res.data) {
var item=res.data[index];
if (item.LastFollowDay<0) {
$("tr[data-index='" + index + "']").attr({"style":"color:red","font-weigth":"bold"})
}else if(item.Status!="有效" ){
$("tr[data-index='" + index + "']").attr({"style":"color:gray","font-weigth":"bold"})
}
else if(item.Status=="預計有效"){
$("tr[data-index='" + index + "']").attr({"style":"color:black" ,"font-weigth":"bold"})
}
}