diff --git a/packages/vue-app/template/index.js b/packages/vue-app/template/index.js index 06fb94f5c571..a82d4c5af73b 100644 --- a/packages/vue-app/template/index.js +++ b/packages/vue-app/template/index.js @@ -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') { %>