时间:2021-02-09 14:32:56 | 栏目:vue | 点击:次
如下所示:
loadingTimer(){ clearInterval(this.$el.loading_timer); const rotate_angle=30,speed=90; this.$el.loading_timer=setInterval(()=>{ const rotate_el=this.$el.querySelector('.rotate'); /*获得当前元素是transform值*/ let origin_angle=rotate_el.style.transform; if(origin_angle){ origin_angle=Number.parseInt(origin_angle.replace(/[^0-9]/ig,'')); }else{ origin_angle=rotate_angle; }; rotate_el.style.transform=`rotate(${origin_angle+rotate_angle}deg)`; console.log(1231264); },speed) }