I am currently working on adding a feature where the icon rotates when the button is clicked, moving from down to up and vice versa in a spinning motion.
Here is the code I have so far:
<template>
<v-btn v-on:click="isShow = !isShow">
<transition name='rotate'>
<v-icon v-if="!isShow">
mdi-menu-down
</v-icon>
</transition>
<v-icon v-show="isShow">
mdi-menu-up
</v-icon>
</v-btn>
</template>
<stlyle scoped>
.rotate-leave-active {
transform: rotate(180deg);
}
.rotate-enter-active {
transform: rotate(180deg);
}
.rotate-enter .rotate-leave-to {
transform: rotate(0deg);
}
.rotate-leave .rotate-enter-to {
transform: rotate(180deg);
}
</style>
Currently, clicking the button causes the arrow icon to rotate and point upwards. However, both icons are briefly displayed simultaneously during this rotation.
Any ideas on how to resolve this issue?