Skip to content

Commit

Permalink
feat(vue-app): pass store to createRouter (#9629)
Browse files Browse the repository at this point in the history
Co-authored-by: pooya parsa <pyapar@gmail.com>
  • Loading branch information
loick and pi0 committed Aug 11, 2021
1 parent 20e7b99 commit a418371
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vue-app/template/index.js
Expand Up @@ -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') { %>
Expand Down

0 comments on commit a418371

Please sign in to comment.