vue增加动画样式@keyframes

 <div class="container">
    <div class="div-hover">Kang</div>
 </div>

.div-hover {
  position: relative;
  width: 100px;
  height: 24px;
  margin: 100px 20px 0 0;
  animation: myRotate 3s linear infinite;
}
@keyframes myRotate {
  0% {
    transform: rotate(0deg);
  }

  50% {
    transform: rotate(180deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

简单写个demo,div转动起来了
vue增加动画样式@keyframes_第1张图片
vue增加动画样式@keyframes_第2张图片

你可能感兴趣的:(vue.js,前端,javascript)