一维数组切换二维数组的方法

xiaoxiao2021-02-28  4

new Vue({ el:"#calender", data:{ // 周 daynamearr:["周日","周一","周二","周三","周四","周五","周六"], // 月 dayarr:[ 0,0,0,0,0,1,0, 0,0,0,0,0,1,0, 0,0,0,0,0,1,0, 0,0,0,0,0,1,0, 0,0,0,0,0,1,0, 0,0,0,0,0,1,0 ], }, methods:{ theweek:function(){ let result=[]; for(let i=0;i<this.dayarr.length;i+=7){ result.push(this.dayarr.slice(i,i+7)); } return result; } } })
转载请注明原文地址: https://www.6miu.com/read-1750025.html

最新回复(0)