JavaScript自动添加删除

从 '{success: true,data: ["a,92","b,0","c,0","d,43","e,0","f,80","g,0","h,50","j,20","k,5"]}'中提取数字作为一行,页面只能显示8行内容,每增加一行需要删除上一行,再添加新一行,并且需要挂载上删除的动画,有没有大佬给个解决思路

慕姐8265434
浏览 396回答 2
2回答

杨魅力

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()添加新数组
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript