0.11.4
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 (viavm.$emit('change')
, not DOM events), the parent'sonChildChange
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 withv-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.
- Now accepts both camelCase and dash-case, so both
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 propertya
, whena
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 whenVue.config.async
has been set tofalse
. - When
Vue.config.debug
is set to true, Vue will now automatically use synchronous mode and throw adebugger
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