移动端对代码的执行较为严格  语句出现undefined或其他时,不报错同时页面空白 或 在created中获取不到data的值,并且不能改变data的属性

例如:

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

  设置memberId 时,从缓存中获取,若缓存中的userInfo为null 则移动端不报错 不执行 不能更改其值以及data中的其他属性的值

        memberId: JSON.parse(getStore("userInfo")).id,

以下为正确 执行: 

memberId: getStore("userInfo")!=null && getStore("userInfo") != "" ? JSON.parse(getStore("userInfo")).id : 9999999,

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄