vue-js-popover icon indicating copy to clipboard operation
vue-js-popover copied to clipboard

No transitions on leave

Open diachedelic opened this issue 8 years ago • 6 comments

It seems only enter transitions are supported - the popover element is removed from the DOM before .v-leave-active, .v-leave-to etc are applied.

diachedelic avatar Nov 22 '17 05:11 diachedelic

Yeah, i will be happy to review a PR if you will fix it.

euvl avatar Nov 22 '17 09:11 euvl

Okay I will see what I can do

diachedelic avatar Nov 22 '17 11:11 diachedelic

Has anyone found a solution to this?

rogue-ninja-creative avatar Sep 02 '18 02:09 rogue-ninja-creative

No sorry @mclassdesigns

diachedelic avatar Sep 03 '18 04:09 diachedelic

I was looking into adding the transitions to the render function instead. Will report back.

rogue-ninja-creative avatar Sep 04 '18 02:09 rogue-ninja-creative

I have found a solution that works. In Popover.vue, nest the original div inside a transition wrapper component, passing the name of the transition as a prop:

return createElement(
    Vue.options.components['Transition'],
    { props: { name: 'show-from-bottom' } },
    [
        createElement(
            'div',
            {
                class: this.className,
                style: this.style,
                attrs: {
                    'data-popover': this.name
                },
                on: {
                    click (event) {
                        event.stopPropagation()
                    }
                },
                ref: 'dropdown'
            },
            this.$slots.default
        )
    ]
)

rogue-ninja-creative avatar Sep 04 '18 08:09 rogue-ninja-creative