<template>
<view class="padding-lr padding-tb-sm">
<view class="blockC text-black my-shadow padding my-radius-30 bg-white ">
<view class="flex justify-center align-center">
<view class="leftBar">
<view class="item"></view>
</view>
<view class="text-center text-xl ">{{text}}</view>
<view class="rightBar">
<view class="item"></view>
</view>
</view>
<view v-if="records.length">
<orderItem @handle="handle" v-for="(item,index) in records.slice(0, 3)" :key="index" :cur="cur" :records="item" :btnText="text"></orderItem>
</view>
<view v-if="records.length > 3" @click="navTo" class="flex justify-center align-center padding-top text-df">
<text class="text-grey">查看更多</text>
<!-- <image src="/static/pup/youjiantou@3x.png" mode="" style="width: 20rpx;height: 20rpx;"></image> -->
</view>
</view>
</view>
</template>
props:{
records:{
type:Array,
default(){
return []
}
}
}

- 发布:2020-09-03 15:18
- 更新:2020-09-04 10:14
- 阅读:3519
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: 正式
HBuilderX版本号: 2.8.8
手机系统: iOS
手机系统版本号: iOS 13.4
手机厂商: 苹果
手机机型: 6S
页面类型: vue
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
1
1
预期结果:
无报错
无报错
实际结果:
报错
报错
bug描述:
cid unmatched [object Object]
TypeError: Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.
父组件调用了4次这个组件,bug不是每次出现,大概5次渲染中有1次报错,而且都是第一个调用组件出现问题,其余3个正常显示,并且组件位置输出undefined,安卓目前没有这问题
2 个回复
1***@163.com - 啊啊啊
请问解决了嘛 我也出现了这个BUG
小少年报
我之前也是报这个错,我解决了参考地址 循环有点小问题
按时付款撒 (作者)
<orderItemDetail v-if="finishTask.length" @handle="getTaskByOrderIdMethods" :cur="currentTab" text="已完成" :records="finishTask" :taskType="currentTab + 1" :status="currentTab"></orderItemDetail>
这一段就是调用上面的组件,在组件上已经用v-if="finishTask.length"判断 ,没有数据理应不会渲染这个组件的呀
2020-09-04 12:24
小少年报
回复 按时付款撒: 我按照你的组件大概测试了一下。我的完全没有报错,我
<view v-for="(val, index) in list" :key="index"><home /></view>
我没有加判断条件都没报错,估计就是组件的问题,组件中有没有空对象.属性然后循环的,而且我绝对相信不是uniapp的bug,而是代码的问题2020-09-04 14:31
想飞的猪
回复 小少年报: 那要如何解决呢?
2022-10-17 11:52