mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
feat(vue-app): pass store
to createRouter
(#9629)
Co-authored-by: pooya parsa <pyapar@gmail.com>
This commit is contained in:
parent
20e7b99eb6
commit
a418371e27
@ -92,10 +92,10 @@ function registerModule (path, rawModule, options = {}) {
|
||||
<% } %>
|
||||
|
||||
async function createApp(ssrContext, config = {}) {
|
||||
const router = await createRouter(ssrContext, config)
|
||||
const store = <%= store ? 'createStore(ssrContext)' : 'null' %>
|
||||
const router = await createRouter(ssrContext, config, { store })
|
||||
|
||||
<% if (store) { %>
|
||||
const store = createStore(ssrContext)
|
||||
// Add this.$router into store actions/mutations
|
||||
store.$router = router
|
||||
<% if (mode === 'universal') { %>
|
||||
|
Loading…
Reference in New Issue
Block a user