smj227227
smj227227
  • 发布:2020-03-25 14:14
  • 更新:2020-03-25 16:02
  • 阅读:786

@tap=toCategory(item) 在H5中item可以获取到 在app中为undefined

分类:uni-app
tap

@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

2020-03-25 14:14 负责人:无 分享
已邀请:
smj227227

smj227227 (作者)

该问题目前已经被锁定, 无法添加新回复