2***@qq.com
2***@qq.com
  • 发布:2020-07-01 12:06
  • 更新:2020-07-02 14:55
  • 阅读:1122

picker 使用没问题 但是后台报TypeError: undefined is not an object

分类:uni-app
<view class="action">  
                <picker mode="selector" @change="bindevaschoolitemListChanges"  :range-key="'itmename'"  :value="evaschoolitemListndex" :range="evaschoolitemList">  
                    <view class="picker">{{evaschoolitemListndex>-1?evaschoolitemList[evaschoolitemListndex].itmename:'请选择'}}</view>  
                </picker>  
            </view>

出错信息如下:
11:55:49.575 [Vue warn]: Error in render: "TypeError: undefined is not an object (evaluating '_vm.evaschoolitemList[
11:55:49.575 _vm.evaschoolitemListndex
11:55:49.576 ].itmename')"
11:55:49.622 found in
11:55:49.636 ---> <Srch> at pages/srch/srch.vue:1
11:55:49.652     at pages/main/main.vue:1
11:55:49.668 TypeError: undefined is not an object (evaluating '_vm.evaschoolitemList[
11:55:49.688 _vm.evaschoolitemListndex
11:55:49.715 ].itmename')
页面可以正常使用,如下附件

2020-07-01 12:06 负责人:无 分享
已邀请:
9***@qq.com

9***@qq.com - 代码的搬运工

同样的问题

9***@qq.com

9***@qq.com - 代码的搬运工

找到问题原因了。我的data的数据定义了数组是[],空数组。视图先加载,里面取值是objects 的取法。所以报错。把data定义的[]默认几条数据在里面。报错就没了

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