通过slice改变列表里面值的长度

2019-04-15 15:24发布

通过slice对数据某一项进行切割其长度 wx.request({ url: 'https://www.easy-mock.com/mock/5c34ac7190862b0b0cf50397/Smlevue/order_num', method:'get', success:(res)=>{ console.log(res) let order=res.data.list; for (let i = 0; i < order.length;i++){ order[i].order_num = order[i].order_num.slice(0,10); } } })