marcpre / demo_vuejs_imgurAPI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

learning_vuejs

Install

Basic

See this repo

Advanced version

install vue-cli

# install vue-cli
$ npm install --global vue-cli
# create a new project using the "webpack" template
$ vue init webpack my-project
# install dependencies and go!
$ cd my-project
$ npm install

Run Project with: $ npm run dev

Start Out

Add the following to your index.html:

    <script src="/vue/dist/vue.js"></script>
    <script type="text/javascript" src="/script.js"></script>

Show elements

Syntax: {{item.title}}

Directives

Vue Directives

Resources

The plugin for Vue.js provides services for making web requests and handle responses using a XMLHttpRequest or JSONP. Use in html <script src="/vue-resource/dist/vue-resource.js"></script>

Use in code:

 this.$http.get('/someUrl').then(response => {

    // get body data
    this.someData = response.body;

  }, response => {
    // error callback
  });

Documentation

v-bind

v-bind:src binds a javascript property to the src

About


Languages

Language:CSS 34.4%Language:JavaScript 33.2%Language:HTML 32.5%