uniapp使用for循环时候,添加触摸事件并绑定数据
记录下自己遇到过的问题:
想要实现的功能是:通过for循环将数据展示到页面中,并且绑定个事件,点击时会打开一个新的页面,并将点击时的模块数据传递到下一个页面,由于第一次用uniapp,废了很大劲,记录下
<view class="poe-main">
<view class=" poe-main-list" v-for="(item,index) in poe_poetry_body" @tap="openPoe" :data-poe="item">
<view class="poe-ca flex-al-ju-cen">
<image src="../../static/tangshi.png" mode=""></image>
</view>
<view class="poe-poetry" >
<view class="poe-title">
<text>{
{item.poe_title}}</text>
</view>
<view class="poe-autor">
<text>{
{item.poe_dynasty}}</text>
<text>·</text>
<text>{
{item.poe_autor}}</text&g