@@ -3,16 +3,20 @@ import App from './App.vue'
33import { createStore } from './store'
44import { createRouter } from './router'
55import { sync } from 'vuex-router-sync'
6+ import titleMixin from './util/title'
67import * as filters from './util/filters'
78
9+ // mixin for handling title
10+ Vue . mixin ( titleMixin )
11+
812// register global utility filters.
913Object . keys ( filters ) . forEach ( key => {
1014 Vue . filter ( key , filters [ key ] )
1115} )
1216
1317// Expose a factory function that creates a fresh set of store, router,
1418// app instances on each call (which is called for each SSR request)
15- export function createApp ( ) {
19+ export function createApp ( ssrContext ) {
1620 // create store and router instances
1721 const store = createStore ( )
1822 const router = createRouter ( )
@@ -22,11 +26,12 @@ export function createApp () {
2226 sync ( store , router )
2327
2428 // create the app instance.
25- // here we inject the router and store to all child components,
29+ // here we inject the router, store and ssr context to all child components,
2630 // making them available everywhere as `this.$router` and `this.$store`.
2731 const app = new Vue ( {
2832 router,
2933 store,
34+ ssrContext,
3035 render : h => h ( App )
3136 } )
3237
0 commit comments