Skip to content

Commit

Permalink
update examples with new computed shorthand
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Feb 2, 2014
1 parent 965b46b commit a1bee31
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 28 deletions.
14 changes: 6 additions & 8 deletions examples/firebase/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,14 @@ var app = new Vue({
}
},
computed: {
isValid: {
$get: function () {
var valid = true
for (var key in this.validation) {
if (!this.validation[key]) {
valid = false
}
isValid: function () {
var valid = true
for (var key in this.validation) {
if (!this.validation[key]) {
valid = false
}
return valid
}
return valid
}
},
methods: {
Expand Down
12 changes: 4 additions & 8 deletions test/functional/fixtures/nested-props.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,11 @@ <h3>Computed property that concats the two: <span v-text="d"></span></h3>
}
},
computed: {
d: {
$get: function () {
return this.msg + (this.a.b.c || '') + (this.a.c || '')
}
d: function () {
return this.msg + (this.a.b.c || '') + (this.a.c || '')
},
sum: {
$get: function () {
return this.hidden.a + this.hidden.b
}
sum: function () {
return this.hidden.a + this.hidden.b
}
},
methods: {
Expand Down
6 changes: 2 additions & 4 deletions test/functional/fixtures/share-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@
shared: shared
},
computed: {
source: {
$get: function () {
return JSON.stringify(this.shared)
}
source: function () {
return JSON.stringify(this.shared)
}
}
})
Expand Down
14 changes: 6 additions & 8 deletions test/functional/fixtures/validation.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,14 @@
}
},
computed: {
isValid: {
$get: function () {
var valid = true
for (var key in this.validation) {
if (!this.validation[key]) {
valid = false
}
isValid: function () {
var valid = true
for (var key in this.validation) {
if (!this.validation[key]) {
valid = false
}
return valid
}
return valid
}
},
methods: {
Expand Down

0 comments on commit a1bee31

Please sign in to comment.