ktquez/vue-extend-layout

electron + vuew + vue-extend-layout

apavelm opened this issue · 6 comments

Hello!
I'm making an electron application with vuejs 2 and webpack4.
I am trying to use vue-extend-layout component for multiple layouts but faced with an error

Uncaught TypeError: require.context is not a function
from this line
var a = require.context('@/layouts', !1, /^./.*.vue$/);
I tried to create "/layouts" folder in different places without luck.

Little extension, but it doesn't solve described problem in full
src.zip

@apavelm
Sorry for the delay in responding.

You config alias @ in webpack?
https://github.com/ktquez/vue-extend-layout#webpack

Yes, @ is used by electron in webpack. I have double checked it.

Check update v1.1.3

But that may be some incompatibility with the electron.

Can you show me how the directory structure of your application is?

directory structure was standard for electron + vuejs project
/main
/renderer - dir where vuejs
/static

I solved this by writing own component inspired by yours :-)
I suspect some incompatibility because of I tried to debug this situation by placing console.log() for paths, and everything looked fine... including @

@apavelm
I also suspected some incompatibility, because I could not propose a solution due to not having tested with projects like electron or quasar yet.

I'll close this question then. Thanks.