How to change the text when WeChat Mini Programs clicks

data is rendered from a list. If you define a data in data and change it when you click, it will change how all the text is clicked.
Click to change the text as shown in the following figure. Click to change the text to follow WeChat Mini Programs"s method of operating dom similar to js. It seems that you can only get the width and height of dom. These location information can not get the text. Please take a look at

.
Mar.07,2021

whether the state of concern is traversed, right? When you click, just pass down the index and change the follow state of the index.


generally, there is a state, changed data, no dom operation, change according to the concern state of this index, data-index= "{{item.index}}", this is the index value, in your data, there may be a concern or not, for example: < view > {item.concern==0? "concern": "followed"} < / view >, by obtaining the data whether to follow, zero line 1 judgment. Click on the concern of the data to change the current index value

Menu