Created
June 13, 2022 10:34
-
-
Save OMGZui/a484a1bd12e47982c3b7e387fe4191e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# html | |
<div class="control-main"> | |
<div :class="`control-item control-item-${control}`" @click="changeControl"></div> | |
<div class="control-item"></div> | |
</div> | |
## js | |
changeControl() { | |
if (this.control < 3) { | |
this.control++; | |
} else { | |
this.control = 0; | |
} | |
} | |
## css | |
.control-item-1 { | |
transform: rotateZ(45deg); | |
} | |
.control-item-2 { | |
transform: rotateZ(90deg); | |
} | |
.control-item-3 { | |
transform: rotateZ(135deg); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment