项目开始前置
一 创建项目----vscode
1-如果没有安装Vue的脚手架,要先安装
执行:npm install --global @vue/cli // 全局安装脚手架
2-创建项目
执行:vue create xxxx xxxx是项目名,不要大写和特殊符号
3-执行第二步的时候进行以下选择,根据需求来
3.1方向键上下选择想要的--这里选择 ==>Manually select features 按回车(选择的是特性配置选项)
Vue CLI v5.0.1
? Please pick a preset: (Use arrow keys)
> Default ([Vue 3] babel, eslint)
Default ([Vue 2] babel, eslint)
Manually select features
3.2 方向键上下移动 空格选择,显示星号==>Babel:es6 转 es5. Router:路由 Vuex:数据容器,存储共享数据. CSS Pre-processors:CSS 预处理器,后面会提示你选择 less、sass、stylus 等. Linter / Formatter:代码格式校验
Check the features needed for your project: (Press <space> to select, <a> to
? Check the features needed for your project: (Press <space> to select, <a> to
toggle all, <i> to invert selection, and <enter> to proceed)
(*) Babel
( ) Type