0%

Vue Init

shopdemo

Project setup

1
npm install

Compiles and hot-reloads for development

1
npm run serve

Compiles and minifies for production

1
npm run build

Customize configuration

See Configuration Reference.

环境搭建:

安装 npm

npm 全称为 Node Package Manager,是一个基于Node.js的包管理器,也是整个Node.js社区最流行、支持的第三方模块最多的包管理器。

1
2
3
npm -v
//查看安装了哪些包
npm list --depth=0

由于网络原因 安装 cnpm

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

安装 vue-cli

2.x:

1
cnpm install -g vue-cli

3.x:

1
cnpm install -g @vue/cli

安装 webpack

webpackJavaScript 打包器(module bundler)

1
cnpm install -g webpack

创建一个项目

2.x:

1
vue init webpack my-project

3.x:

1
2
3
vue create my-project
# OR
vue ui