mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-04 11:27:13 +00:00
Merge branch 'dev' of git://github.com/nuxt/nuxt.js into dev
This commit is contained in:
commit
35b975f061
@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "nuxt-vue-apollo",
|
||||
"dependencies": {
|
||||
"@nuxtjs/apollo": "^2.0.0",
|
||||
"nuxt": "^1.0.0-rc6"
|
||||
"@nuxtjs/apollo": "^2.1.1",
|
||||
"nuxt": "^1.0.0-rc9"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "nuxt",
|
||||
|
@ -43,7 +43,11 @@ const defaultTransition = <%=
|
||||
async function createApp (ssrContext) {
|
||||
const router = createRouter()
|
||||
|
||||
<% if (store) { %>const store = createStore()<% } %>
|
||||
<% if (store) { %>
|
||||
const store = createStore()
|
||||
// Add this.$router into store actions/mutations
|
||||
store.$router = router
|
||||
<% } %>
|
||||
|
||||
// Create Root instance
|
||||
// here we inject the router and store to all child components,
|
||||
@ -151,6 +155,9 @@ async function createApp (ssrContext) {
|
||||
if (typeof <%= plugin.name %> === 'function') await <%= plugin.name %>(ctx, inject)<% }) %>
|
||||
}<% } %>
|
||||
|
||||
// Inject context
|
||||
inject('ctx', ctx)
|
||||
|
||||
if (process.server && ssrContext && ssrContext.url) {
|
||||
await new Promise((resolve, reject) => {
|
||||
router.push(ssrContext.url, resolve, reject)
|
||||
|
Loading…
Reference in New Issue
Block a user