1 | npm install -g @vue/cli |
1 | vue create vue-app |
1 | ? Please pick a preset: (Use arrow keys) |
1 | ? Check the features needed for your project: |
可以直接按数字键1,2,3,4进行选择
1 | Use class-style component syntax? (Y/n) y |
是否使用Class风格装饰器?
即原本是:home = new Vue()创建vue实例
使用装饰器后:class home extends Vue{}
大专栏 vue-cli3初始化项目ass="gutter">1 | Use Babel alongside TypeScript for auto-detected polyfills? (Y/n) y |
使用Babel与TypeScript一起用于自动检测的填充? yes
1 | Use history mode for router? (Requires proper server setup for index fallback in production) (Y/n) y |
路由使用历史模式? 这种模式充分利用 history.pushState API 来完成 URL 跳转而无须重新加载页面
1 | ? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): (Use arrow keys) |
使用什么css预编译器? 看个人习惯
1 | ? Pick a linter / formatter config: (Use arrow keys) |
tslint: typescript格式验证工具
eslint w…: 只进行报错提醒;
eslint + A…: 不严谨模式;
eslint + S…: 正常模式;
eslint + P…: 严格模式;
建议选择正常模式
1 | ? Pick additional lint features: (Press <space> to select, <a> to toggle all, <i> to invert selection) |
代码检查方式
可以在项目最外层新建vue.confi.js
来配置端口,代理等配置,具体可以参照官方文档
原文:https://www.cnblogs.com/lijianming180/p/12370743.html