vue-cli 3
创建项目
vue create demo
图形化管理
vue ui
自定义配置的方式:
第一种:可以用vue ui页面设置
第二种:在项目根目录下创建一个vue.config.js文件,在里面进行配置
项目路径起别名
在项目根目录下创建一个vue.config.js文件,在里面进行别名配置:
vue.config.js:
module.exports = {
configureWebpack: {
resolve: { //配置项目文件夹的路径别名
alias: {
'assets': '@/assets',
'common': '@/common',
'components': '@/components',
'network': '@/network',
'views': '@/views'
}
}
}
}
关闭生命周期不能使用console.log的配置
module.exports = {
lintOnSave: false, //关键代码 => 设置成false之后就可以用console.log了
configureWebpack: {
resolve: {
alias: {
'assets': '@/assets',
'common': '@/common',
'components': '@/components',
'network': '@/network',
'views': '@/views'
}
}
}
}
在根目录下配置.editorconfig文件
.editorconfig:
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true