点击后隐藏或显示某一行数据。在小程序开发时,经常需要实现在点击完列表中的某一行数据后,就能展开其对应的相关内容或隐藏其对应的内容
index.wxml
<
view
class=
'text'>
<
text
>方法一
</
text
>
</
view
>
<
view
wx:for=
"{
{list}}"
wx:key=
"content"
wx:for-index=
"key">
<
view
class=
'title'
data-index=
'{
{key}}'
bindtap=
'hiddenBtn'>
<
label
>aaa {
{item.id+1}}
</
label
>
</
view
>
<
view
hidden=
'{
{item.hidden}}'>
<
view
class=
'line'></
view
>
<