Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

electron-vue里的__static路径问题 #33

Open
ChenPt opened this issue May 9, 2019 · 0 comments
Open

electron-vue里的__static路径问题 #33

ChenPt opened this issue May 9, 2019 · 0 comments
Labels
electron electron

Comments

@ChenPt
Copy link
Owner

ChenPt commented May 9, 2019

__static是electron-vue提供的一个变量,electron原生是没有的。
对应的是当前项目目录的static文件夹。
在开发环境下测试时,__static这个变量是由webpack来进行处理的,实际上就是当前开发项目的根目录下的static文件夹。而在生产环境中,__static变量被保存到nodejs提供的global对象里去,需要保证的是,得等到他已经确认挂载到了global对象上再去引用。
BUG: 打包后打开可执行文件,发现报错: __static is not defined
而在开发环境下是没有问题的。因为开发环境下的__static变量并没有挂载到global对象上。
修改代码引用顺序就可以了。

@ChenPt ChenPt added the electron electron label Nov 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
electron electron
Projects
None yet
Development

No branches or pull requests

1 participant