Vue.js: 0.12.1 Release

Release date:
June 16, 2015
Previous version:
0.12.1-csp.2 (released June 16, 2015)
Magnitude:
500 Diff Delta
Contributors:
2 total committers
Data confidence:
Commits:

Top Contributors in 0.12.1

yyx990803
nervgh

Directory Browser for 0.12.1

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

Release Notes Published

Breaking Changes

It is unfortunate that I have to make a breaking change right after the 0.12 release, but I believe this is a necessary change before users have already invested in the new API. - #### Prop Binding Types have been redesigned.

updated docs - All prop bindings are now one-way-down by default. This means parent changes are synced to the child but not the other way around. This default is meant to prevent child components from accidentally mutating the parent's state, which can make your app's data flow harder to reason about. - You can still explicitly create a two way binding with the new syntax:

``` html
<component prop="{{@ twoWayBound }}"></component>
```
  • One-way-up binding type has been removed.
  • One-time binding remains the same using the prop="{{* oneTime }}" syntax.

New Features

  • #### Prop Validation

updated docs

You can now optionally define a prop as an object that contains additional validation requirements:

  Vue.component('example', {
    props: [
      {
        name: 'on-something',
        type: Function
      },
      {
        name: 'required-prop',
        required: true
      },
      {
        name: 'greater-than-ten',
        // custom validator function
        validator: function (value) {
          return value > 10
        }
      }
    ]
  })

The type can be one of the following native constructors: - String - Number - Boolean - Function - Object - Array

In addition, type can also be a custom constructor function and the the assertion will be made with an instanceof check.

When a prop validation fails, Vue will refuse the set the value on the child component, and throw a warning if using the development build.

You can still use strings if your props don't need any validation, and you can mix string and object props in the option array.

Fixed

  • #924 multiline expressions in attributes
  • #936 <content> transclusion regressions