一.初始化vue项目
1.环境初始化
1.安装node,
2.安装淘宝npm镜像提高下载速度。 npm install -g cnpm --registry=https://registry.npm.taobao.org
3.安装vue脚手架vue-cli。 npm install -g vue-cli
4 创建项目.创建一个基于 webpack 模板的新项目demo。 vue init webpack demo
【创建过程中会提示是否需要vue-router、eslint、unit tests等:
【current directory ? === Y
project name
description // 描述,不需要就回车
author // 作者 自己分配到的git账号
vue build ? === standalone
install vue-router? === Y
user ESLint to lint your code ? ====Y
pick an ESLint preset ? ====Standard
set up unit tests ====Y
pick a test runner ===== jest
setup e2e tests with Nightwatch ? ===== Y
should we run ‘npm instll’for you after the project has been created? ==== n】
5.切换到项目目录 cd demo
6.下载安装依赖模块 cnpm install
npm run lint
npm run test
7.启动运行: npm run dev