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行内容,每增加一行需要删除上一行,再添加新一行,并且需要挂载上删除的动画,有没有大佬给个解决思路
紫衣仙女
浏览 456回答 2
2回答

回首忆惘然

letdata={success:true,data:["a,92","b,0","c,0","d,43","e,0","f,80","g,0","h,50","j,20","k,5"]};letcol=data.data.map((v)=>{returnv.split(',')[1];});我觉得可以用二维数组存储使用Array.shift()删除第一个数组使用Array.unshift()添加新数组
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript