<div class="show-box" ref="rotate" @mousedown="moveImg" @mousewheel.prevent="rollImg($event,)">
<img :src="singleList.fileImgUrl" class="uploadimg" ref="img" :style="{transform:'scale('+multiples/100+') rotate('+rotate +'deg)'}"/>
</div>
<div class="img-plus" @click="toBIgChange()"><span class="tip">放大</span></div>
<div class="img-minus" @click="toSmallChange()"><span class="tip">缩小</span></div>
<div class="img-rotate" @click="toRotate()"><span class="tip">旋转</span></div>
</div>
可以用JAvascript改变这个图片的css来旋转他:这个是css代码:
img {
transform:rotate(7deg)
-ms-transform:rotate(7deg) /* IE 9 */
-moz-transform:rotate(7deg) /* Firefox */
-webkit-transform:rotate(7deg)/* Safari 和 Chrome */
-o-transform:rotate(7deg) /* Opera */
}
在JAvascript里面可以先获取到这张图片 设置图片id = "box"
var img = document.getElementById('box') 获取到这个图片并用变量记住
img.style.transform = "rotate(90deg)" 改变这个图片的css,旋转90度
完毕!!!