富贵资源网 Design By www.hznty.com

非常简单,只要加一个配置!

第1步,复制这个代码(端口可改)

 "config": {
  "nuxt": {
   "host": "0.0.0.0",
   "port": "8090"
  }
 },

第2步,找到根目录下的package.json,把代码粘贴进去。

这是全部的代码,我这里配置在了8~13行。

{
 "name": "guanWangPhone",
 "version": "1.0.0",
 "description": "My bee's knees Nuxt.js project",
 "author": "kason",
 "private": true,

 "config": {
  "nuxt": {
   "host": "0.0.0.0",
   "port": "8090"
  }
 },
 
 "scripts": {
  "dev": "cross-env NODE_ENV=development nodemon server/index.js --watch server",
  "build": "nuxt build",
  "start": "cross-env NODE_ENV=production node server/index.js",
  "generate": "nuxt generate"
 },
 "dependencies": {
  "cross-env": "^5.2.0",
  "element-ui": "^2.4.11",
  "koa": "^2.6.2",
  "nuxt": "^2.0.0",
  "postcss-px2rem": "^0.3.0"
 },
 "devDependencies": {
  "node-sass": "^4.13.0",
  "nodemon": "^1.18.9",
  "sass-loader": "^8.0.0",
  "scss-loader": "0.0.1"
 }
}

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。

富贵资源网 Design By www.hznty.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
富贵资源网 Design By www.hznty.com