IDE解析代码bug
发布于 6 年前 作者 yinfang 17006 次浏览 来自 问答
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 回复

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

回到顶部