Vue.js: 1.0.0-rc.2 Release

Release date:
October 23, 2015
Previous version:
1.0.0-rc.2-migration (released October 23, 2015)
Magnitude:
11,932 Diff Delta
Contributors:
5 total committers
Data confidence:
Commits:

30 Features Released with 1.0.0-rc.2

Top Contributors in 1.0.0-rc.2

yyx990803
vprimachenko
wprater
zOxta
humanismusic

Directory Browser for 1.0.0-rc.2

We haven't yet finished calculating and confirming the files and directories changed in this release. Please check back soon.

Release Notes Published

The corresponding migration build for this release is 1.0.0-rc.2-migration.

New

  • v-for now support the v-for="(key, val) in obj" or v-for="(index, val) in arr" syntax. This allows nested loops to more easily reference the key or index.
  • v-on can now omit the expression if it has modifiers. e.g. @submit.prevent will call preventDefault() on submit events.
  • Custom directive API improvement:

Custom directives can now provide a params Array, and the Vue compiler will automatically extract these attributes on the element that the directive is bound to. The old undocumented this.param() directive instance method has been deprecated.

Example:

  <div v-example a="hi"></div>
  Vue.directive('example', {
    params: ['a'],
    bind: function () {
      console.log(this.params.a) // -> "hi"
    }
  })

This API also supports dynamic attributes. The this.params[key] value is automatically kept up-to-date. In addition, you can specify a callback when the value has changed:

  <div v-example :a="someValue"></div>
  Vue.directive('example', {
    params: ['a'],
    paramWatchers: {
      a: function (val, oldVal) {
        console.log('a changed!')
      }
    }
  })

Fixed

  • #1431 props with the same name not properly merged
  • #1440 v-for components detach hook not called
  • #1442 directives on a child component root not resolved in the right scope
  • #1458 :class array syntax not removing stale classes