Vue之Hello World!

最近在学习vue.js,写下笔记

一、安装npm及cnpm

1、安装node

https://nodejs.org/dist/latest/

选择:node-v13.3.0-x64.msi

Vue之Hello World!

会继续安装必要工具

Vue之Hello World!

Vue之Hello World!

把node.exe所在目录加入path环境变量中

>node --version

(v13.3.0)

2、安装git

(略过)

>git --version

(git version 2.18.0.windows.1)

3、安装npm

>d:

>cd vue

>git config --system http.sslcainfo/bin/curl-ca-bundle.crt

>git clone --recursive git://github.com/isaacs/npm.git

>cd npm

>npm --version

4、安装cnpm

>cd ..

>npm install -g cnpm --registry=https://registry.npm.taobao.org

二、使用VueCli快速构建项目

>cnpm install vue-cli -g

>vue --version

 

创建项目:

>d:

>cd vue\project

>vue init webpack new01

(配置如下)

Vue之Hello World!

>cd new01

>cnpm install

>npm start

Vue之Hello World!

在浏览器输入:http://localhost:8080 访问

Vue之Hello World!

然后在另一个控制台,输入

>d:

>cd vue\project\new01

>npm run build

Vue之Hello World!

这样就创建了一个HelloWorld项目