Entry file

Your entry file must export a function which returns an object containing at least a router property.

import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default () => {
  return {
    router: new Router({
      mode: 'history',
      routes: []
    })
  }
}

router

A vue-router instance.

root

  • Default: router-view

Custom root component

extendRootOptions

  • Type: rootOptions => void

A function that manipulates root Vue app options. e.g. adding i18n to root options:

export default () => {
  const i18n = new VueI18n()
  return {
    extendRootOptions(rootOptions) {
      rootOptions.i18n = i18n
    }
  }
}

document

  • Type: context => html

See more about custom document.

getDocumentData

  • Type: (context) => data | Promise<data>

Get context.data for the document method. The context here is the same as getInitialData's context argument.

getInitialDataContext

  • Type: context => void

Modify the context argument of getInitialData method of each route component.

store

  • Type: Vuex.Store

Use a Vuex instance here for server-side data pretching with Vuex.

This is implemented via a built-in plugin.

apolloProvider

  • Type: VueApollo

Use a VueApollo instance here for server-side data prefetching with Apollo.

This is implemented via a built-in plugin.