安装vue/cli4依赖
npminstall -g @vue/cli
需要先安装好nodejs和npm、vue
node -v
npm -v
vue -V
进入我们的工作目录:
#使用脚手架安装项目:
vue init webpack demo
提示目录已存在,是否继续:Y
Project name(工程名):回车
Project description(工程介绍):回车
Author:作者名
Vue build(是否安装编译器):回车
Install vue-router(是否安装Vue路由):回车
Use ESLint to lint your code(是否使用ESLint检查代码):y
Set up unit tests(安装测试工具):n
Setup e2e tests with Nightwatch(也是测试相关):n
Should we run `npminstall`for you after the project has been created? (recommended):选择:No, I will handle that myself
初始化项目:
cnpm i
运行项目:
cnpm run dev
安装项目依赖,分别是scss支持,ajax工具,element ui,两个兼容包sass一种相似与css的文件,axios,vue中的ajax,用于后台交互
cnpm i node-sass -D
cnpm i sass-loader -D
cnpm i axios -D
cnpm i element-ui -D
cnpm i babel-polyfill -D
cnpm i es6-promise -D