1
0
mirror of https://github.com/robonen/canvas-3d.git synced 2026-03-20 10:54:39 +00:00

feat(components): accordion icon animation

This commit is contained in:
2022-11-21 05:40:46 +07:00
parent eec4d3d061
commit 2d891c76cd
4 changed files with 11 additions and 14 deletions

View File

@@ -8,8 +8,7 @@ const showForm = ref<boolean>(false);
<div class="header" @click="showForm = !showForm">
<h2>{{ title }}</h2>
<button class="button">
<IconClose v-if="showForm"/>
<IconOpen v-else/>
<IconOpen class="icon" :class="{icon_close: showForm}"/>
</button>
</div>
<div class="content" v-show="showForm">
@@ -35,6 +34,14 @@ const showForm = ref<boolean>(false);
padding: 8px 0;
}
.icon {
transition: transform 0.2s;
&_close {
transform: rotate(180deg);
}
}
.button {
color: var(--icon-color);
}