Releases: vuejs/vue
0.12.15
1.0.0-alpha.4
Alpha versions are pre-releases and the API may change at any time. By using the alpha releases you are responsible for any risk involved. If you have an in-production 0.12 app, it's recommended to wait until the stable 1.0 migration release before upgrading.
Changes from 1.0.0-alpha.3
Breaking
For latest binding syntax, see #1173
-
Literal directives now use the
#=
syntax instead of.=
:<a v-link#="/a/b/c"></a>
-
Prop binding type indicators are now placed in the attribute name instead of the value:
<comp bind-two-way@="something" bind-one-time*="something"> </comp>
-
v-el
andv-ref
are deprecated and now use dedicate syntax:<!-- registers vm.$.child --> <comp $.child></comp> <!-- registers vm.$$.node --> <div $$.node></div> <!-- caveat: must use dash-case instead of camelCase, similar to props --> <!-- registers vm.$.someComp --> <comp $.some-comp></comp>
-
v-component
has been deprecated in favor of theis
attribute, which is now usable on any element. -
The
prefix
global config has been deprecated.
New
-
v-else
: must be used following an element withv-if
.<div v-if="ok">OK</div> <div v-else>NOT OK</div>
-
Unsafe delimiters for HTML interpolation can now be configured separately:
Vue.config.unsafeDelimiters = ['{!!', '!!}']
Note in 1.0.0-alpha when you set
Vue.config.delimiters
, it will still implicitly update the unsafe delimiters following the current rules, but in 1.0.0-beta and above settingdelimiters
will have no effect onunsafeDelimiters
.
Non-breaking Changes
- Removed overly aggressive "unobservable object" warnings.
slot
attributes on transcluded content are now preserved.
Fixed
- Fixed issue where minified build calling non-existent deprecation warning when using legacy syntax
- #1249
v-for
error when used with 3rd party sortable plugins (@weislanes) - #1268 component
<slot>
not compiled in correct scope when insidev-for
- #1282
<slot>
fallback content not compiled in correct scope when insidev-for
- #1295 error when triggering transitions on fragments
Internals, for Advanced Users
-
FragmentFactory
is now exposed asVue.FragmentFactory
. -
User can now extend Vue's option merging strategies by adding functions to
Vue.config.optionMergeStrategies
:Vue.config.optionMergeStrategies.myOption = function (parentValue, childValue) { // return merged value }
The above function will be called when calling
Vue.extend({ myOptions: { ... }})
, or when applying a mixin that includesmyOption
.
0.12.14
1.0.0-alpha.3
Alpha versions are pre-releases and the API may change at any time. By using the alpha releases you are responsible for any risk involved. If you have an in-production 0.12 app, it's recommended to wait until the stable 1.0 migration release before upgrading.
Known Issue
- Not working with vue-router 0.5.2.
Please wait for a vue-router update.Please upgrade to vue-router 0.6.0.
Changes since 1.0.0-alpha.2
For an detailed overview of the data-binding syntax changes, see the latest proposal.
-
All fixes in 0.12.13
-
Props now share the same
bind-
syntax with normal attributes.<comp literal-prop="string" bind-dynamic-prop="someThing" bind-two-way="@someThing" bind-one-time="*someThing"> </comp>
-
Add
:
shorthand forbind-
.The example above can be shortened as:
<comp literal-prop="string" :dynamic-prop="someThing" :two-way="@someThing" :one-time="*someThing"> </comp>
-
Event handler key filter delimiter changed from
:
to-
:<!-- 1.0.0-alpha.2 --> <input on-keyup:esc="handleEsc"> <!-- 1.0.0-alpha.3 --> <input on-keyup-esc="handleEsc">
-
bind-style
now support an Array of style objects:<div bind-style="[styleObjectA, styleObjectB]"></div>
-
Use
.=
syntax to pass a literal string to directives:<a v-link.="/a/b/c">
v-link
's update function will be called once with"/a/b/c"
.
0.12.13
Fixed
- Observer will only attempt to convert a data object if it is not a native object, e.g
window
. - #1219 inherit: true constructor cache should be context-sensitive
- #1248 performance regression when
v-repeat
has a particularly large source Array. - #1241 Triggering a transitionend event after enter transition is done in in-out mode causes error (@nkovacs)
- #1244 Leave transition hook is called twice if css:false in in-out mode
Improvements
- Added
space
alias forkey
filter. (@Coffcer)
1.0.0-alpha.2
Alpha versions are pre-releases and the API may change at any time. By using the alpha releases you are responsible for any risk involved. If you have an in-production 0.12 app, it's recommended to wait until the stable 1.0 migration release before upgrading.
Changed
- Computed properties are again cached by default (was uncached by default in alpha 1).
Fixed
- #1234 Filters are not applied with the correct scope inside
v-for
- Calling
Vue.use
more than once on a plugin will not install it again.
1.0.0-alpha.1
Alpha versions are pre-releases and the API may change at any time. By using the alpha releases you are responsible for any risk involved. If you have an in-production 0.12 app, it's recommended to wait until the stable 1.0 migration release before upgrading.
1.0.0-alpha.1 is the first release of the 1.0.0-alpha stage. As promised in 1.0.0 release planning, this release contains no breaking changes, but a lot of deprecation warnings and tips on how to migrate to the new features. Try it out in your ^0.12.10 compatible app and let me know how it goes!
For detailed changes, see the tracking issues and in app deprecation warnings.
Note that at this stage, the API design is still not locked yet; issues marked as "1.0 proposal" are still open to discussion. Feedback after trying it out in real apps are particularly appreciated.
You will probably notice the file is a bit larger than previous versions, this is because the alpha releases contain all the backwards compatible code. Once removed in the beta, the file will slim down again.
Installing
NPM
npm install [email protected]
Bower
bower install vue#1.0.0-alpha.1
Standalone files in the 1.0.0-alpha branch: https://github.com/yyx990803/vue/tree/1.0.0-alpha/dist
0.12.12
Improvements
-
v-model
on checkbox can now bind the model value to expressions instead of justtrue
orfalse
. Example:<input type="checkbox" v-model="example" true-exp="a" false-exp="b">
// when checked: vm.example === vm.a // when unchecked: vm.example === vm.b
-
v-model
on radio also gets the same feature:<input type="radio" v-model="example" exp="a">
// when checked: vm.example === vm.a
Fixed
v-model
on checkbox should now update the input checked state based on truthy-ness again. In 0.12.11 it is only checked when value strictly equalstrue
.
0.12.11
Improvements
-
Two-way filters for
v-model
have been reworked. Av-model
binding with read filters will no longer attempt to format the value when the user is still typing; instead it formats the value on blur. This results in a much more natural UX and makes two-way filters much more usable. Demo -
<select v-model="x" options="options">
now supports Object values. That is to say you can provide theoptions
array like this:options = [ { text: 'a', value: { msg: 'A' }}, { text: 'b', value: { msg: 'B' }}, { text: 'c', value: { msg: 'C' }} ]
And the bound value
x
will be the actual object instead of a serialized string. -
filterBy
filter has been improved (#1094):- It now accepts multiple
dataKeys
arguments - Each
dataKey
argument can be either a String or an Array of Strings. - You can alternatively provide a custom filter function as the first argument.
Example:
<!-- multiple dataKeys --> <div v-repeat="user in users | filterBy searchText in 'fieldA' 'fieldB'"> <!-- Array dataKeys --> <!-- fields = ['fieldA', 'fieldB'] --> <div v-repeat="user in users | filterBy searchText in fields"> <!-- filter by function --> <div v-repeat="user in users | filterBy myCustomFilterFunction">
- It now accepts multiple
-
currency
filter can now accept an empty string argument to output the result without a currency symbol. -
When in
debug
mode, Vue will also print async stack traces for warnings. Previously the stack trace stops at the internal batcher handler due to Vue's async update queue; now the stack trace goes all the way back to what originally triggered the update. -
Component asset names can also be in PascalCase in addition to camelCase:
myComponent
andMyComponent
will both be interpreted asmy-component
during the lookup. -
Data object properties prefixed with
_
and$
are now also observed; this means they can be used for data binding, however if it is a root-level property it will not be proxied on the vm instance.For example:
var vm = new Vue({ data: { _test: 123 } }) vm._test // -> undefined vm.$data._test // -> 123
<!-- also need to access via $data in templates --> <p>{{ $data._test }}</p>
-
Computed Property Caching
You can now turn off caching for a specific computed property so that it behaves like a simple getter.
By default, a computed propoerty's cache is only invalidated when one of its reactive dependencies have changed, but this can result in confusion when the user assumes it behaves like a getter.
For example:
computed: { example: function () { return Date.now() + this.msg } }
The cache for
vm.example
only invalidates whenvm.msg
has changed, because Vue has no way to detect whetherDate.now()
has changed or not (polling is obviously a bad idea). So, when you accessvm.example
, it will not change unlessvm.msg
has changed.This is different from a simple getter-like behavior, where the function is re-evaludated every time the property is accessed. If that is what you want, you can turn off caching for that property like this:
computed: { example: { get: function () { /* same getter */ }, cache: false } }
New
-
Added
debounce
filter which can be used withv-on
for debouncing DOM events.Example:
<input v-on="input: onInput | denounce 300">
Fixed
v-attr
should also set corresponding properties forselected
andchecked
.- #1139 error when compiling props for a component with fragment
el
- #1150
keep-alive
andwait-for
not working together - #1152 dynamic component left undestroyed with
keep-alive
+wait-for
- #1155 select option with empty string initial value not initialized properly
- #1162 computed properties evaluation affected by order of data manipulations
- #1185
v-if
linker cache not taking transclusion host into account - #1191 resolveAsset not working properly for transcluded components in strict mode
0.12.10
Improvements
-
Support one static
<option>
inside<select>
withv-model
+ dynamic options:<select v-model="selectedUser" options="users"> <option value="">Select a user...</option> </select>
This static option will be selected by default if the
v-model
value is falsy (excluding0
). Options created fromusers
will be appended after the default option. -
Dynamic component
wait-for
listeners are now attached in the component'screated
hook, thus firing the event synchronously incompiled
hook will now properly trigger the DOM insertion.
Fixed
- template parser now trims empty textNodes from
<script>
templates, avoiding unnecessarily turning components into fragment mode. - #1109 mustach tags inside
<textarea>
are interpolated only once - #1116 transition hangs when immediately leaving after entering
- #1117 synchronously calling
done
inleave
transition hook causes error - #1118 nested
<template>
not rendering in Safari - #1119
out-in
transition mode not working as desired when switching faster than transition duration. - #1124
number
attribute param forv-model
not respected on<input type="radio">
.