Skip to content

Commit a1bee31

Browse files
committed
update examples with new computed shorthand
1 parent 965b46b commit a1bee31

File tree

4 files changed

+18
-28
lines changed

4 files changed

+18
-28
lines changed

examples/firebase/app.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,14 @@ var app = new Vue({
3232
}
3333
},
3434
computed: {
35-
isValid: {
36-
$get: function () {
37-
var valid = true
38-
for (var key in this.validation) {
39-
if (!this.validation[key]) {
40-
valid = false
41-
}
35+
isValid: function () {
36+
var valid = true
37+
for (var key in this.validation) {
38+
if (!this.validation[key]) {
39+
valid = false
4240
}
43-
return valid
4441
}
42+
return valid
4543
}
4644
},
4745
methods: {

test/functional/fixtures/nested-props.html

+4-8
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,11 @@ <h3>Computed property that concats the two: <span v-text="d"></span></h3>
3535
}
3636
},
3737
computed: {
38-
d: {
39-
$get: function () {
40-
return this.msg + (this.a.b.c || '') + (this.a.c || '')
41-
}
38+
d: function () {
39+
return this.msg + (this.a.b.c || '') + (this.a.c || '')
4240
},
43-
sum: {
44-
$get: function () {
45-
return this.hidden.a + this.hidden.b
46-
}
41+
sum: function () {
42+
return this.hidden.a + this.hidden.b
4743
}
4844
},
4945
methods: {

test/functional/fixtures/share-data.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,8 @@
4444
shared: shared
4545
},
4646
computed: {
47-
source: {
48-
$get: function () {
49-
return JSON.stringify(this.shared)
50-
}
47+
source: function () {
48+
return JSON.stringify(this.shared)
5149
}
5250
}
5351
})

test/functional/fixtures/validation.html

+6-8
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,14 @@
4545
}
4646
},
4747
computed: {
48-
isValid: {
49-
$get: function () {
50-
var valid = true
51-
for (var key in this.validation) {
52-
if (!this.validation[key]) {
53-
valid = false
54-
}
48+
isValid: function () {
49+
var valid = true
50+
for (var key in this.validation) {
51+
if (!this.validation[key]) {
52+
valid = false
5553
}
56-
return valid
5754
}
55+
return valid
5856
}
5957
},
6058
methods: {

0 commit comments

Comments
 (0)