Skip to content

Instantly share code, notes, and snippets.

@yyx990803
Created November 2, 2015 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yyx990803/283d87c8d35708a768ec to your computer and use it in GitHub Desktop.
Save yyx990803/283d87c8d35708a768ec to your computer and use it in GitHub Desktop.
var example = new Vue({
data: {
a: 1
},
computed: {
b: function () {
return this.a + 1
}
}
})
// both a & b are proxied on the created instance.
example.a // -> 1
example.b // -> 2
example.a++
example.b // -> 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment