Skip to content

0.12.0-beta5

Pre-release
Pre-release
Compare
Choose a tag to compare
@yyx990803 yyx990803 released this 30 May 02:45
· 3591 commits to main since this release

Improvements

  • Transition system refactor: CSS transitions and JavaScript transition hooks can now work together! The list of available JavaScript hooks have also been expanded. Here is a list of all available hooks:

    • beforeEnter
    • enter
    • afterEnter
    • beforeLeave
    • leave
    • afterLeave

    You can use these hooks to do additional work while having the CSS part handled for you automatically. The refactor maintains backwards compatibility so your old transitions should still work. One important thing to note though: the done callback in enter and leave hooks is now optional, similar to how it is optional in a Mocha test. Vue will look at the number of arguments of the function to determine whether the hook expects to control when the transition should end. For example:

      {
        enter: function (el) {
           // No `done` argument, so the end of the transition
           // will depend on the CSS `transitionend` or
           // `animationend` event.
        }
      }

    vs.

      {
        enter: function (el, done) {
          // the `done` callback here indicates that you want
          // to explicitly control when the transition should end.
          // the transition will only end when you call this callback.
        }
      }
  • New instance method: vm.$nextTick. This is the same as Vue.nextTick, except that it can be called inside instance methods as this.$nextTick, and the callback's this context will be auto-bound to the current instance. This avoids having to require the global Vue inside a component module just to use Vue.nextTick.

  • Optimized instance initialization, which increases first-render performance by roughly 30%.

Fixed