@tab=function(item) 在H5中item可以获取到 在app中为undefined
贴上代码
<scroll-view scroll-y="true" class="right">
<view class="category" v-for="(category,index) in categoryList" :key="category.id" v-show="category.cid==showCategoryIndex">
<view v-for="(box,i) in category.data" :key="i">
<view style="text-align: center"><text style="color: gainsboro">—</text>
<text style="color: #000000;margin-right: 8px;margin-left: 8px">{{box.next_name}}</text>
<text style="color: gainsboro">—</text>
</view>
<view class="list">
<view class="box" v-for="(item,ind) in box.info" :key="ind" @tap="toCategory(item.id)">
<image :src="item.img"></image>
<view class="text">{{item.son_name}}</view>
</view>
</view>
</view>
</view>
</scroll-view>
h5可以正常获取@tap="toCategory(item.id)中的item.id app中会报undefined is not an object
1 个回复
smj227227 (作者)