vue js给元素动态添加动画样式, 改变背景色
for (let i = 0; i < 10; i++) {const dom = document.getElementById('mydiv' + i);document.styleSheets[0].insertRule(`@keyframes flash-${i} {0% {background-color: #ff0000;}100% {background-color: #ffffff;}}`,0);dom.style.animation = `flash-${i} 1s infinite alternate`;
}