feat(vue-app): pass store to createRouter (#9629)

Co-authored-by: pooya parsa <pyapar@gmail.com>
This commit is contained in:
Loick Le Digabel 2021-08-11 22:30:18 +02:00 committed by GitHub
parent 20e7b99eb6
commit a418371e27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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') { %>