uniapp使用picker报错Error in render: "TypeError: Cannot read property 'XXX' of undefined&

uniapp中,使用picker来渲染对象数组,且数据是从后台获取,页面代码如下:

uniapp使用picker报错Error in render: "TypeError: Cannot read property 'XXX' of undefined&

 获取数据代码如下:

uniapp使用picker报错Error in render: "TypeError: Cannot read property 'XXX' of undefined&

 遇到报错:

uniapp使用picker报错Error in render: "TypeError: Cannot read property 'XXX' of undefined&

 这里的错是说,projectName这个属性没有定义,所以,只需要在对象数组中添加该属性即可:

之前是:

uniapp使用picker报错Error in render: "TypeError: Cannot read property 'XXX' of undefined&

 改为:

uniapp使用picker报错Error in render: "TypeError: Cannot read property 'XXX' of undefined&

 如果使用hbuilder内置浏览器,多刷新两次可能才会看到不报错;

以上;

上一篇:剑指offer 016、合并两个排序的链表


下一篇:C# DateTimePicker控件如何精确设置显示时分秒