收藏
回答

IDE解析代码bug

success:(res)=>{
                console.log(res);
                wx.hideLoading();
                self.setData({
                    Page: res.data,
                    Reg: res.data.reg,
                    carpreAry: res.data.item_carnum.carpreAry,
                    item_ticket_show: res.data.item_ticket.show,                                 //---是否渲染罚单编号
                    item_name_show: res.data.item_name.show,                                   //---是否隐藏被处罚人姓名输入框
                    item_licence_show: res.data.item_licen.show,                                //---是否隐藏驾驶证输入框
                    item_carnum_show: res.data.item_carnum.show,                                 //---是否隐藏车牌号输入框
                    item_serveMoney_show: res.data.item_servemoney.show,                             //---滞纳金服务费
                    item_upload_show: res.data.item_upload.show,                                 //---是否隐藏上传条目
                    item_paymoney_show: res.data.item_paymoney.show,                               //---是否渲染支付费用
                });
                let pageCode = res.data.pageCode;
                console.log(pageCode);
                console.log(typeof pageCode);
                if(pageCode=="0"){
                    wx.setNavigationBarTitle({
                        title: res.data.naviTitle[0]
                    })
                }
                else if(pageCode=="1"){
                    wx.setNavigationBarTitle({
                        title: res.data.naviTitle[1]
                    })
                }
            },

控制台输出信息截图如下

只是普通的string类型的1,为什么会报未定义属性?难道IDE不能解析字符串类型?

回答关注问题邀请回答
收藏

1 个回答

  • HS
    HS
    2017-09-29

    console.log(res.data.naviTitle) 看看呢。

    2017-09-29
    有用
    回复
登录 后发表内容