Vue项目开发手册

1.基础环境搭建

1.1. 安装Node.js (建议使用LTS版本)

1.2. nrm安装及npm registry设置

1
2
3
4
// use npm
npm i nrm -g
// use yarn
yarn global add nrm
1
2
3
4
5
6
7
8
9
10
11
# nrm ls

npm -------- https://registry.npmjs.org/
yarn ------- https://registry.yarnpkg.com/
cnpm ------- http://r.cnpmjs.org/
* taobao ----- https://registry.npm.taobao.org/
nj --------- https://registry.nodejitsu.com/
npmMirror -- https://skimdb.npmjs.com/registry/
edunpm ----- http://registry.enpmjs.org/

# nrm use taobao

1.3 vue-cli安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//安装环境
# npm i @vue/cli -g

//创建项目
# vue create vue-test

// - 启动服务
# npm run serve

// - 打包编译
# npm run build

// - 执行lint
# npm run lint

// - 执行单元测试
# npm run test:unit