在项目根目录新建 vue.config.js 配置文件module.exports = { devServer: { host: 'localhost', //本地 port: 900, //端口号 open: true //默认false true自动打开 }}