Achieve the effect: first enter the page to determine whether the color is out of stock!
code show as below:
<block wx:for="{{colorInfo}}" wx:key="key">
<text class="{{colorSelect[index]}}">{{item.colorComment}}</text>
</block>
The colorInfo and colorSelect arrays both have values
Expand colorInfo and take a look
or specify
I tried it, this method is possible
![](http://img.php.cn/upload/image/000/000/001/f420e1328886046808893aac4d684d5f-1.png)
Definition in js:
Page display
![](http://img.php.cn/upload/image/000/000/001/f420e1328886046808893aac4d684d5f-2.png)
The structure displayed on the final interface:
![](http://img.php.cn/upload/image/000/000/001/2ab056ee80d3444cad1df6d9bc45c440-3.png)
Page display
![](http://img.php.cn/upload/image/000/000/001/2ab056ee80d3444cad1df6d9bc45c440-4.png)