nuxt.js里路径被占用,怎么修改当前路径
Posted Mia73
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nuxt.js里路径被占用,怎么修改当前路径相关的知识,希望对你有一定的参考价值。
在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"
}
}
以上是关于nuxt.js里路径被占用,怎么修改当前路径的主要内容,如果未能解决你的问题,请参考以下文章