Vue-js-modal: What transitions are supported?

Created on 15 Nov 2017  ·  4Comments  ·  Source: euvl/vue-js-modal

What are the valid values for the transition property?

question

Most helpful comment

@dland512 I had the same question as you and as I am a noob to Vue I didn't find @euvl 's comments very helpful (no disrespect).

I had a read through the source code and found that the modal div in the Modal.vue file is wrapped in a transition element. See the Vue Transition Docs for details on how transitions work.

Essentially all you need to do is pick a name like fade and then make sure the appropriate css classes that Vue will be looking for are available. Here is an example for fading in.

.fade-enter,
.fade-leave-to { opacity: 0; }
.fade-enter-active,
.fade-leave-active { transition: .5s; }

Then when you create your component set the transition parameter to fade and your 👌 .

<modal name="hello-world" transition='fade'>
    Hello, ☀️!
</modal>

I hope this helps others.

All 4 comments

Not what the data type of the property is, but what are the valid values it can have, e.g. "fade-in", "slide-in", etc.

Basically I want the dialog to slide up from the bottom rather than fade in. Is that possible?

the valid values is a name of whatever transition you will make.
It is possible, if you will create fade in transition, its like 4 lines of css.

@dland512 I had the same question as you and as I am a noob to Vue I didn't find @euvl 's comments very helpful (no disrespect).

I had a read through the source code and found that the modal div in the Modal.vue file is wrapped in a transition element. See the Vue Transition Docs for details on how transitions work.

Essentially all you need to do is pick a name like fade and then make sure the appropriate css classes that Vue will be looking for are available. Here is an example for fading in.

.fade-enter,
.fade-leave-to { opacity: 0; }
.fade-enter-active,
.fade-leave-active { transition: .5s; }

Then when you create your component set the transition parameter to fade and your 👌 .

<modal name="hello-world" transition='fade'>
    Hello, ☀️!
</modal>

I hope this helps others.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MacgyverMartins picture MacgyverMartins  ·  4Comments

Zyles picture Zyles  ·  5Comments

Max64 picture Max64  ·  4Comments

ptilli picture ptilli  ·  3Comments

at0g picture at0g  ·  3Comments