Vue 安装及使用

来源:互联网 发布:湖南干部教育网络app 编辑:程序博客网 时间:2024/06/09 16:43

Vue 安装

使用 npm 安装 vue:

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

使用 npm 安装 vue-cli:

# 全局安装 vue-clinpm install --global vue-cli -g --registry=https://registry.npm.taobao.org

体验Vue项目

执行

# 创建一个基于 webpack 模板的新项目vue init webpack my-project
   vue-cli · Generated "my-project".   To get started:     cd my-project     npm install     npm run dev

命令后,就可http://localhost:8080/访问了。

Build Setup

# install dependenciesnpm install# serve with hot reload at localhost:8080npm run dev# build for production with minificationnpm run build# build for production and view the bundle analyzer reportnpm run build --report# run unit testsnpm run unit# run e2e testsnpm run e2e# run all testsnpm test

更多资料

vuejs中文官方文档

Vue.js 入门教程

原创粉丝点击