从 '{success: true,data: ["a,92","b,0","c,0","d,43","e,0","f,80","g,0","h,50","j,20","k,5"]}'中提取数字作为一行,页面只能显示8行内容,每增加一行需要删除上一行,再添加新一行,并且需要挂载上删除的动画,有没有大佬给个解决思路
2 回答
杨魅力
TA贡献1811条经验 获得超6个赞
let data = {success: true,data: ["a,92","b,0","c,0","d,43","e,0","f,80","g,0","h,50","j,20","k,5"]};
let col = data.data.map((v) => {
return v.split(',')[1];
});
我觉得可以用二维数组存储
使用Array.shift()删除第一个数组
使用Array.unshift()添加新数组
添加回答
举报
0/150
提交
取消