文章中涉及vue项目都是基于vu-cli快速构建,展示的目录结构是vue-cli快速构建之后的目录。Electron-vue也是基于vue-cli的脚手架工具。小伙伴们自己构建的vue项目想要改造成桌面应用,还请移步 Electron将Web页面打包成桌面应用实例 。
2018.11.13更新——实操过程中遇到的问题
1. 关于<template lang="html"> (Emitted value instead of an instance of Error)
错误提示:
Module Error (from ./node_modules/vue-loader/lib/loaders/templateLoader.js):
(Emitted value instead of an instance of Error)
错误截图:
错误代码:
<template lang="html">
<router-view></router-view>
</template>
问题解析:
这段代码在原先的vue项目中是没有问题的,copy到electron-vue项目之后,不明所以的报错。删掉lang="html"就可以正常运行了。至于原因,猜测vue项目和electron-vue项目中对于.vue文件的编译方式不