Skip to content

0.11.4

Compare
Choose a tag to compare
@yyx990803 yyx990803 released this 07 Dec 21:01
· 3593 commits to main since this release

New

  • New directive: v-events

    This directive allows you to listen to a child component's events in the template:

    <!-- inside parent template -->
    <div v-component="child" v-events="change: onChildChange"></div>

    When the child component fires a change event (via vm.$emit('change'), not DOM events), the parent's onChildChange method will be invoked. This allows more decoupled parent-child communication without having to hard-code event listeners into the parent component.

    Note v-events can only be used together with v-component, i.e. on the root element of a child component.

  • v-style improvements

    • Now accepts both camelCase and dash-case, so both "margin-left" and "marginLeft" work the same way.
    • The old syntax for auto-prefixing (prefix with $) has been deprecated; v-style now automatically detects and caches the appropriate prefix to add when setting the styles, so you can just use non-prefixed properties without worrying about it.

Changed

  • User watcher callbacks registered via vm.$watch() are now guaranteed to be fired after directives that depend on the same data have been updated. For example, if a directive and a $watch callback both depend on the data property a, when a changes, the directive will perform the DOM update first, then the $watch callback will be called. This ensures that inside $watch callbacks the DOM will always be in a resolved state. Note this mechanism is not guaranteed when Vue.config.async has been set to false.
  • When Vue.config.debug is set to true, Vue will now automatically use synchronous mode and throw a debugger statement when there is a warning. This enables the user to inspect the full stack trace in browser dev tools.

Fixed

  • fixed a bug that causes custom element syntax + v-repeat not working together
  • #618