Vue快速入门

来源:互联网 发布:淘宝用户需求分析 编辑:程序博客网 时间:2024/05/16 12:08
  1. NPM安装
    下载node.js安装,自带了npm,命令行检查是否安装成功
npm --version
  1. 安装cnpm
$ npm install -g cnpm --registry=https://registry.npm.taobao.org
  1. vue 工程创建
# 全局安装 vue-cli$ cnpm install --global vue-cli# 创建一个基于 webpack 模板的新项目$ vue init webpack my-project# 这里需要进行一些配置,默认回车即可This will install Vue 2.x version of the template.For Vue 1.x use: vue init webpack#1.0 my-project? Project name my-project? Project description A Vue.js project? Author runoob <test@runoob.com>? Vue build standalone? Use ESLint to lint your code? Yes? Pick an ESLint preset Standard? Setup unit tests with Karma + Mocha? Yes? Setup e2e tests with Nightwatch? Yes   vue-cli · Generated "my-project".   To get started:     cd my-project     npm install     npm run dev   Documentation can be found at https://vuejs-templates.github.io/webpack
  1. 使用IDEA打开工程,终端运行
$ cd my-project$ cnpm install$ cnpm run dev DONE  Compiled successfully in 4388ms
  1. 浏览器打开http://localhost:8080/#/getmeter,如下
    这里写图片描述

具体使用:http://element.eleme.io/#/zh-CN/component/installation

原创粉丝点击