原子和电子-无法获得/

时间:2018-10-05 09:56:57

标签: vue.js electron nuxt.js

我已经发布了一个问题https://github.com/nuxt-community/electron-template/issues/27,但也许在这里会更有效

我使用了nuxt-community/electron-template模板,生成了应用程序。

在开发模式下,一切正常。但是,如果我构建该应用程序,则会得到Cannot GET /

命令:

  "scripts": {
    "dev": "cross-env NODE_ENV=DEV electron .",
    "dev:web": "cross-env NODE_ENV=DEV BUILD_TARGET=web  nuxt",
    "build": "nuxt build && electron-builder",
    "build:web": "cross-env nuxt build",
    "start": "cross-env nuxt build && nuxt start"
  },

奇怪的是,模板开箱即用。如何正确配置电子和nuxt一起工作?

1 个答案:

答案 0 :(得分:0)

这就是我所做的,没有问题

1)创建一个名为模板的文件夹

D:\ Coding \ template

2)从github-https://github.com/nuxt-community/electron-template

下载electron-template-master.zip

3)将ZIP的内容(模板文件夹,许可证,META,自述文件)复制到D:\ coding \ template

4)mkdir项目

D:\ Coding \ projects

5)cd项目

6)npm install vue-cli

7)vue初始化D:\ Coding \ template项目

8)cd项目

9)npm install

10)npm运行构建

enter image description here