From a418371e277339fb1e51d0789cad876ef843758e Mon Sep 17 00:00:00 2001 From: Loick Le Digabel Date: Wed, 11 Aug 2021 22:30:18 +0200 Subject: [PATCH] feat(vue-app): pass `store` to `createRouter` (#9629) Co-authored-by: pooya parsa --- packages/vue-app/template/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vue-app/template/index.js b/packages/vue-app/template/index.js index 06fb94f5c5..a82d4c5af7 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') { %>