前言:在小程序的开发中,我们在view中便利data中数组或对象时,很多情况下需要在js中动态改变数组或者对象中某一香的属性值。
效果图:
我给大家总结了案例如下:
wxml如下:
{ {item.week}}
{ {item.date}}
wxss如下:
.hd-cont {
height: 126rpx;
white-space: nowrap;
padding-left: 20rpx;
color: #fff;
font-size: 28rpx;
box-sizing: border-box;
}
.date-cont {
width: 40rpx;
margin-right: 70rpx;
height: 100%;
display: inline-block;
padding-top: 10rpx;
box-sizing: border-box;
text-align: center;
}
.curl {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
line-height: 40rpx;
}
.date-cont view:first-child {