-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event #13
Comments
same question, cant make it work when I click just hover or page refresh |
this can be done by creating a state variable and defining the css animation class when that variable meets a condition (ex: set state to true on click, play animation, settimeout state back to false). unsure if there are plans to make an easier handler but this works for now |
The shortest way I found is this (for non looping animations): <script>
const doAnimation = ref(false)
</script>
<template>
<button
:class="{'motion-opacity-out-0':doAnimation}"
@click='doAnimation = true'
@animationend='doAnimation = false'
>
anmiate
</button
</template> In Vue, maybe a wrapper component with slot props could help remove the animation variable from the script. |
Can we "activate" the animation on click event ?
The text was updated successfully, but these errors were encountered: