ES6拼接数组与小程序本地存储

拼接数组

ES6扩展运算符【三个点(...)将一个数组转为用逗号分隔的参数序列】

 goodsList: [...goodsList, ...goods]

本地存储

// 把接口数据存入本地存储中
wx.setStorageSync('cates', { time: Date.now(), data: this.Cates });
wx.getStorageSync('cart');
posted @ 2020-12-18 15:24  东血  阅读(111)  评论(0编辑  收藏  举报

载入天数...载入时分秒...