File tree 3 files changed +12
-8
lines changed
3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -42,14 +42,16 @@ export default {
42
42
43
43
route: {
44
44
data ({ to }) {
45
- return store .fetchItem (to .params .id ).then (item => ({
46
- item,
47
- // the final resolved data can further contain Promises
48
- comments: store .fetchItems (item .kids ),
49
- pollOptions: item .type === ' poll'
50
- ? store .fetchItems (item .parts )
51
- : null
52
- }))
45
+ return store .fetchItem (to .params .id ).then (item => {
46
+ document .title = item .title + ' | Vue.js HN Clone'
47
+ return {
48
+ item,
49
+ // the final resolved data can further contain Promises
50
+ comments: store .fetchItems (item .kids ),
51
+ pollOptions: item .type === ' poll'
52
+ ? store .fetchItems (item .parts )
53
+ : null
54
+ }})
53
55
}
54
56
},
55
57
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ export default {
50
50
// the entire object, because we don't want to update the page before
51
51
// the items are fetched.
52
52
const page = + to .params .page
53
+ document .title = ' Vue.js HN Clone'
53
54
return store .fetchItemsByPage (page).then (items => ({
54
55
page,
55
56
items
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ export default {
35
35
data ({ to }) {
36
36
// Promise sugar syntax: return an object that contains Promise fields.
37
37
// http://router.vuejs.org/en/pipeline/data.html#promise-sugar
38
+ document .title = ' Profile: ' + to .params .id + ' | Vue.js HN Clone'
38
39
return {
39
40
user: store .fetchUser (to .params .id )
40
41
}
You can’t perform that action at this time.
0 commit comments