WeChat Mini Programs: how to mark the unique attribute of the circular rendered view list and click to change the state!

because the view is rendered in a loop, it doesn"t get it right for a long time

clipboard.png

clipboard.png

use ternary operation to judge the id currently clicked, and then display:none
thought is completely wrong
circular rendering list, all are unified variables
there is no way to modify the attribute
according to id as js does. I really can"t figure it out!

<view class="weike-body-dian" id="{{item.id}}" style="display:{{ item.id== record[mesgid].id ? record[mesgid].display : "" }}"> <view></view></view>

describe the problem clearly first. You have no idea what effect you want to achieve


data is stored in the array. When rendering, tie a data-id, and click the method to determine whether the current id matches the id in the array. If it matches, change the custom attribute state in the array, and choose whether to turn on

by customizing the attribute status.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e83c2f-45708.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e83c2f-45708.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?