Vue is a progressive JavaScript framework that focuses on building user interfaces. You can see [VueJS in action online] (https://jsfiddle.net/chrisvfritz/50wL7mdz/) or install it on local. The simplest way to run it locally is using an official template.

Vue.js 2 Quickstart Tutorial 2017

Install

vuejs install

Prerequisites: Node.js (>=4.x, 6.x preferred) and Git.

$ npm install -g vue-cli
$ vue list

  Available official templates:

  ★  browserify - A full-featured Browserify + vueify setup with hot-reload, linting & unit testing.
  ★  browserify-simple - A simple Browserify + vueify setup for quick prototyping.
  ★  simple - The simplest possible Vue setup in a single HTML file
  ★  webpack - A full-featured Webpack + vue-loader setup with hot reload, linting, testing & css extraction.
  ★  webpack-simple - A simple Webpack + vue-loader setup for quick prototyping.

$ vue init simple <project-name>

Official Templates

The purpose of official Vue project templates are to provide opinionated, battery-included development tooling setups so that users can get started with actual app code as fast as possible.

All official project templates are repos in the vuejs-templates organization.

Standalone vs. Runtime

Vue 2.0 uses a virtualDOM. Because of this Vue has to convert all HTML templates into render functions - also this HTML that you used in your HTML file.

The compiler responsible for this is included in the “standalone” build, but not in the “runtime-only” build.

Vue-loader / vueify does this compile step during build, and usually you can setup your app to only rely on .vue files. In that case, you can use the runtime-only build and save a few kb.

https://github.com/vuejs-templates Vue.js 2.0 is out, first impressions VueJs: The Basics Making HTTP Requests with vue-resource

How to access nested data objects?

<a v-bind:href="settings.url"></a>

...

data: {
	settings: {},
	...
}

How can I bind the html content in vuejs?

document.title document.body

Google map

https://jsfiddle.net/crabbly/o3ahd45z/

this.$el.querySelector(‘a’)

https://jsfiddle.net/9mu9h1cf/

Escape html in view

Retiring vue-resource

Retiring vue-resource

Axios: Promise based HTTP client for the browser

Stay Connected


Victor Dias

Sharing mobile Experiences

Follow me