From d4d7d27be6e9766c793a178f0dd2c61d3d11d071 Mon Sep 17 00:00:00 2001 From: webmech Date: Tue, 6 Nov 2018 18:17:11 -0500 Subject: [PATCH 1/4] fix(vuex-electron): patch vuex-electron. currently does not work unless you require the store in the main process. https://github.com/SimulatedGREG/electron-vue/issues/733 --- template/src/main/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/template/src/main/index.js b/template/src/main/index.js index 6f57e9f2..5ca4aab3 100644 --- a/template/src/main/index.js +++ b/template/src/main/index.js @@ -4,6 +4,13 @@ {{/if_eq}} import { app, BrowserWindow } from 'electron'{{#if_eq eslintConfig 'airbnb'}} // eslint-disable-line{{/if_eq}} +{{#isEnabled plugins 'vuex-electron'}} +/** + * Vuex will not work without this + */ +import '../renderer/store'{{#if_eq eslintConfig 'airbnb'}} // eslint-disable-line{{/if_eq}} +{{/isEnabled}} + /** * Set `__static` path to static files in production * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html From 7b83366af74e8fb6d7c82e81590313f218722849 Mon Sep 17 00:00:00 2001 From: webmech Date: Tue, 6 Nov 2018 23:49:10 -0500 Subject: [PATCH 2/4] style(main): fix double spacing issue if no vuex enabled --- template/src/main/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template/src/main/index.js b/template/src/main/index.js index 5ca4aab3..9e2e5043 100644 --- a/template/src/main/index.js +++ b/template/src/main/index.js @@ -8,9 +8,9 @@ import { app, BrowserWindow } from 'electron'{{#if_eq eslintConfig 'airbnb'}} // /** * Vuex will not work without this */ -import '../renderer/store'{{#if_eq eslintConfig 'airbnb'}} // eslint-disable-line{{/if_eq}} -{{/isEnabled}} +import '@/renderer/store'{{#if_eq eslintConfig 'airbnb'}} // eslint-disable-line{{/if_eq}} +{{/isEnabled}} /** * Set `__static` path to static files in production * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html From 0499c53d4cd80497278ba5ce22d048d67b2e337e Mon Sep 17 00:00:00 2001 From: webmech Date: Wed, 7 Nov 2018 00:03:32 -0500 Subject: [PATCH 3/4] fix(main): correct reference to vuex store --- template/src/main/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/src/main/index.js b/template/src/main/index.js index 9e2e5043..34db57fa 100644 --- a/template/src/main/index.js +++ b/template/src/main/index.js @@ -8,7 +8,7 @@ import { app, BrowserWindow } from 'electron'{{#if_eq eslintConfig 'airbnb'}} // /** * Vuex will not work without this */ -import '@/renderer/store'{{#if_eq eslintConfig 'airbnb'}} // eslint-disable-line{{/if_eq}} +import '../renderer/store'{{#if_eq eslintConfig 'airbnb'}} // eslint-disable-line{{/if_eq}} {{/isEnabled}} /** From cbf46a5d506e1d0f14866241792f6d3f846617e8 Mon Sep 17 00:00:00 2001 From: webmech Date: Wed, 7 Nov 2018 08:03:38 -0500 Subject: [PATCH 4/4] fix(main): only include vuex store if vuex plugin enabled --- template/src/main/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/src/main/index.js b/template/src/main/index.js index 34db57fa..f43a5a27 100644 --- a/template/src/main/index.js +++ b/template/src/main/index.js @@ -4,7 +4,7 @@ {{/if_eq}} import { app, BrowserWindow } from 'electron'{{#if_eq eslintConfig 'airbnb'}} // eslint-disable-line{{/if_eq}} -{{#isEnabled plugins 'vuex-electron'}} +{{#isEnabled plugins 'vuex'}} /** * Vuex will not work without this */