本文由 简悦 SimpRead 转码, 原文地址 blog.csdn.net
临时指定端口
方式一
port=5000 npm run serve
方式二
npm run serve -- --port 8081
注意:--是不能省略的。
永久配置
在vue.config.js中添加
const {defineConfig} = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
//更改默认端口
devServer: {
open: false, // 自动打开浏览器
port: 8081,
},
//设置是否在开发环境下每次保存代码时都启用 eslint验证
lintOnSave: false
})
浙公网安备 33010602011771号