Vue 开发环境 搭建 新
2021年6月18日1安装vue cli
使用npm 安装vue cli
,就是vue命令行工具这样就直接可以使用vue
命令, 理解为laravel 的 artisan
吧
1 |
> npm install -g @vue/cli |
2创建vue项目根据选项
1 |
> vue create vuejs-essential #创建项目 |
按照下方提示选择安装
1 2 3 4 5 6 |
Vue CLI v4.3.1 ? Please pick a preset: Manually select features ? Check the features needed for your project: Babel, Router, Vuex ? Use history mode for router? (Requires proper server setup for index fallback in production) No ? Where do you prefer placing config for Babel, ESLint, etc.? In package.json ? Save this as a preset for future projects? No |
安装其他组件
1 2 3 4 |
> npm install sass-loader sass -D #添加sass预处理器 > npm install bootstrap-sass --save #添加bootstrap样式,禁止`vue add bootstrap-sass`因为没有加入vue的官方组件 > npm install font-awesome --save #添加字体 > npm install vue-router --save #安装vue-router |