在package.json文件里面添加
"config":{ "nuxt":{ "host":"localhost",//可以为本地路径 "port":"3001"//自己定义 } }, 路径就变成http://localhost:3001 以下是示例
{ "name": "nuxt-demo", "version": "1.0.0", "description": "Nuxt.js project", "author": "", "private": true, "scripts": { "dev": "nuxt", "build": "nuxt build", "start": "nuxt start", "generate": "nuxt generate", "lint": "eslint --ext .js,.vue --ignore-path .gitignore .", "precommit": "npm run lint" }, "config":{ "nuxt":{ "host":"localhost", "port":"3001" } }, "dependencies": { "nuxt": "^1.0.0" }, "devDependencies": { "babel-eslint": "^8.2.1", "eslint": "^4.15.0", "eslint-friendly-formatter": "^3.0.0", "eslint-loader": "^1.7.1", "eslint-plugin-vue": "^4.0.0" } }
原文地址:https://www.cnblogs.com/MiaDeng/p/9288250.html
时间: 2024-10-29 17:31:59