Skip to content

Commit 5228456

Browse files
Add some explanatory comments to the code in the README
1 parent cdbbbda commit 5228456

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,16 @@ new Vue({
178178
},
179179
asyncComputed: {
180180
blogPostContent: {
181+
// The `get` function is the same as the function you would
182+
// pass directly as the value to `blogPostContent` if you
183+
// didn't need to specify a default value.
181184
get () {
182185
return Vue.http.get('/post/' + this.postId)
183186
.then(response => response.data.postContent)
184187
},
188+
// The computed proporty `blogPostContent` will have
189+
// the value 'Loading...' until the first time the promise
190+
// returned from the `get` function resolves.
185191
default: 'Loading...'
186192
}
187193
}

0 commit comments

Comments
 (0)