q1b / petiteVueTransition

MIT License
24 stars 4 forks source link

[fix] when show is false, make the element display none #3

Open neterm opened 2 years ago

q1b commented 1 year ago

Hey, I want to merge it. But did you test it because not, then I will test it before merging to main branch

q1b commented 1 year ago

neterm It's sweet that you added event for after-leave, is it possible for before-enter as well.

neterm commented 1 year ago

you can copy the code and modify it!

neterm commented 1 year ago
        if (get() && !isTransitioning) {
          isTransitioning = true
          const e = new CustomEvent('before-enter')
          el.dispatchEvent(e)

          tr = transition(
            el,
            enterClasses,
            enterFromClasses,
            enterToClasses,
            enteredClasses,
            (reason) => {
              if (reason === Reason.Finished) isTransitioning = false
            }
          )
neterm commented 1 year ago
        if (get() && !isTransitioning) {
          isTransitioning = true
          const e = new CustomEvent('before-enter')
          el.dispatchEvent(e)

          tr = transition(
            el,
            enterClasses,
            enterFromClasses,
            enterToClasses,
            enteredClasses,
            (reason) => {
              if (reason === Reason.Finished) isTransitioning = false
            }
          )

I am not sure~u can test it~

uniuwe commented 1 year ago

Hey, sorry for last time. It's a very nice! upgradation to existing codebase.