移动端对代码的执行较为严格 语句出现undefined或其他时,不报错同时页面空白 或 在created中获取不到data的值,并且不能改变data的属性
例如:
设置memberId 时,从缓存中获取,若缓存中的userInfo为null 则移动端不报错 不执行 不能更改其值以及data中的其他属性的值
memberId: JSON.parse(getStore("userInfo")).id,
以下为正确 执行:
memberId: getStore("userInfo")!=null && getStore("userInfo") != "" ? JSON.parse(getStore("userInfo")).id : 9999999,