Skip to content

Commit 9f515e4

Browse files
authored
update asyncData to serverPrefetch for title mixin (#261)
1 parent bca4010 commit 9f515e4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/guide/head.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@ Now, a route component can make use of this to control the document title:
5050
// Item.vue
5151
export default {
5252
mixins: [titleMixin],
53+
5354
title () {
5455
return this.item.title
5556
},
5657

57-
asyncData ({ store, route }) {
58-
return store.dispatch('fetchItem', route.params.id)
58+
serverPrefetch () {
59+
return this.$store.dispatch('fetchItem', this.$route.params.id)
5960
},
6061

6162
computed: {

0 commit comments

Comments
 (0)