Skip to content
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

How to use transition with vue-js-popover? #39

Open
DenniLa2 opened this issue Aug 24, 2018 · 3 comments
Open

How to use transition with vue-js-popover? #39

DenniLa2 opened this issue Aug 24, 2018 · 3 comments

Comments

@DenniLa2
Copy link

In my example transitions don`t work =(
codesandbox
Where can i mistake or what can I write to work my example? Thanks!

@egillespie
Copy link

@DenniLa2, it looks like there aren't any styles to perform the fade transition. If you add the following block to the end of your MyTooltip.vue file, you should see a transition:

<style scoped>
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.7s;
}
.fade-enter,
.fade-leave-to {
  opacity: 0;
}
</style>

Updated sandbox example.

@demiavaliani
Copy link

demiavaliani commented Nov 9, 2022

For future readers, in your template you should add a single class to transition prop, like this:

<popover
	name="my-tooltip"
	transition="my-tooltip"
	:event="'hover'"
	:pointer="false"
	>
</popover>

Later, prepend that same class to Vue transition classes to apply the animation. So, for example, a tooltip element that fades in on hover with 0.2 second transition-duration will look like this:

// "enter" state (start state of an element)
.my-tooltip-enter {
	opacity: 0;
}

// "enter-to" state (end state of an element)
.my-tooltip-enter-to {
	opacity: 1;
}

// "enter-active" state (duration of the animation. add your transition here)
.my-tooltip-enter-active {
	transition: opacity 0.2s ease-out 0s;
}

@darrenklein
Copy link

Thank you, that was not at all clear from the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants