2.1 项目运行起来时,让浏览器自动打开
在项目根目录下的package.json文件里面的scripts里面的serve后面加上
--open
"scripts": {
"serve": "vue-cli-service serve --open",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
2.2 eslint校验功能关闭
— 在根目录下,创建一个vue.config.js
module.exports = {
// 关闭eslint
lintOnSave:false
}
2.3 src文件简写方法,配置别名
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@/*": ["src/*"]
}
},
"exclude": ["node_modules", "dist"]
}
注意:
每设置一项建议重启一下项目,这样可以检测项目有没有出现问题,配置有没有成功