一、安装vue
-
安装vue-cli
npm install vue-cli -g
-
验证是否安装成功
vue list
二、配置vue
- 切换镜像
npm config set registry [https://registry.npm.taobao.org](https://registry.npm.taobao.org/)
- 查询当前镜
npm config get registry
国内推荐使用淘宝镜像,否则在使用npm install下载资源库文件时,会特变的慢;
三、新建vue项目
1.使用webpack直接创建
- 新建test项目
vue init webpack test
- 下载资源库
npm install
- 运行
cd test; npm run dev
- 浏览器上查看,使用浏览器打开http://localhost:8081
2.使用脚手架(CLI)创建
四、项目配置
- 安装插件
dayjs
:npm install --save dayjs
截图
网友评论