How does Mini Program judge the added style?

< view bindtap= "shopselect" wx:key= "speckone" wx:for= "{{pagedata.Specs}}" class=" {{item.RealStock > 0? "zl": "nohave"} "data-max= "{{item.RealStock}}" data-id= "{{item.Id}}"

{{item.SpecValue}} < / view >

this is the view that is looped out.
but through the shopselect event. When you click on a view. Add the act class to the view. Other view cancels act. How do you write it?

Sep.11,2021

my expressive ability is not good, so I wrote a small demo, for reference. I don't know if you want this effect.
Code snippet is as follows:
Code snippet, click to jump

.
Menu