electron 项目,想要用 vue 组件,应该需要怎么配置呢
需求:现在我有一个 electron 项目,一个.vue 文件,我应该怎么配置,才能把 vue 文件集成到项目中去呢
尝试了 electron 与 vue 的 script 进行通信,但是会报错:The server responded with a non-JavaScript MIME type of “text/plain”,是不是项目的一些配置需要做调整?
需求:现在我有一个 electron 项目,一个.vue 文件,我应该怎么配置,才能把 vue 文件集成到项目中去呢
尝试了 electron 与 vue 的 script 进行通信,但是会报错:The server responded with a non-JavaScript MIME type of “text/plain”,是不是项目的一些配置需要做调整?
Vue 本身可以只引入一个 js 直接新建个页面放进去不就好了
如果想用 .vue 文件,根据你目前表现出来的水平。。。还是直接找个 electron-vue 项目把你们代码移过去可能要稳妥点吧 https://simulatedgreg.gitbooks.io/electron-vue/content/cn/
https://github.com/nklayman/vue-cli-plugin-electron-builder
进阶就可以直接拿现成的脚手架直接放 那样更方便
[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.
所以说应该还是需要改配置文件,但是我这个项目是纯 electron 项目,上面报错我所搜索到的解决方案在我这里并不适用,所以说,纯 electron 项目想要用 vue 难道必须要配置环境吗
你要不要试试 HTML + iframe(vue)
——-
但是「让前端看起来更舒服一点」,你是不是只要 css 就可以了?根本不需要用 Vue 的组件