1.dom
<div>
<div class="rotate-icon">


</div>
<div>
```

```

</div>
</div>
2.js
引入jquery旋转插件
<script src="/src/assets/js/jquery.rotate.js"></script>
// 旋转图片
rotateImg(type) {
let rot = this.rot;
if (type == "left") {
if (rot === -360) {
rot = 0;
}
rot -= 90;
$("#rotImg").rotate(-90);
}
if (type == "right") {
if (rot === 360) {
rot = 0;
}
rot += 90;
$("#rotImg").rotate(90);
}
this.rot = rot;
},
网友评论