















<template>
<div>
<img :style="imageStyle" src="path/to/your/image.jpg" alt="Rotated Image">
<button @click="rotateImage">Rotate Image</button>
</div>
</template>
<script>
export default {
data() {
return {
rotation: 0, // 旋转的角度
};
},
computed: {
imageStyle() {
return {
transform: `rotate(${this.rotation}deg)`,
};
},
},
methods: {
rotateImage() {
this.rotation += 90; // 每次点击旋转90度
},
},
};
</script>
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。