Commit edb6192c authored by Evan You's avatar Evan You

improve spinner inactive state using v-show

parent bc1b6b18
<template> <template>
<svg class="spinner" :class="{ show: show }" width="44px" height="44px" viewBox="0 0 44 44"> <transition>
<svg class="spinner" :class="{ show: show }" v-show="show" width="44px" height="44px" viewBox="0 0 44 44">
<circle class="path" fill="none" stroke-width="4" stroke-linecap="round" cx="22" cy="22" r="20"></circle> <circle class="path" fill="none" stroke-width="4" stroke-linecap="round" cx="22" cy="22" r="20"></circle>
</svg> </svg>
</transition>
</template> </template>
<script> <script>
...@@ -19,14 +21,15 @@ $duration = 1.4s ...@@ -19,14 +21,15 @@ $duration = 1.4s
z-index 999 z-index 999
right 15px right 15px
bottom 15px bottom 15px
opacity 0
transition opacity .15s ease transition opacity .15s ease
animation rotator $duration linear infinite animation rotator $duration linear infinite
animation-play-state paused animation-play-state paused
&.show
.spinner.show
opacity 1
animation-play-state running animation-play-state running
&.v-enter, &.v-leave-active
opacity 0
&.v-enter-active, &.v-leave
opacity 1
@keyframes rotator @keyframes rotator
0% 0%
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment