Front-end framework vue study notes

compatibility

IE8 is not compatible with the following

 

Vue Devtools  better able to review and debugging interface

 

Environment to build

1.nodejs (new version integrates npm) is a node [npm package management node package manager]

Download nodejs (http://nodejs.cn)

terminal node -v view the installation is successful, npm -v view npm version installed successfully

 

2. Install vue

npm install vue

Vue install scaffolding

npm install --global vue-cli

 

project

1. vue introduced in the package file html <script type = "text / javascript" src = "file address packet"> </ script>

Novice best introduction vue.js prompted, vue.min.js is a compressed version

2. In the script tag by the object to the new new vue vue ()

new shock ({

  el: '# app', // el: indicate the destination of behavior

  template: '', // template presentation template loaded

  data: function () {// dynamic loading data, function () refers to a function, which can also be used // object, but less commonly used

  return {

   // returns inside the template data, for example,

    text: 'hello world', // return data {} {} form, as follows div module

  }

  }

})

I.e., the body tag div, <div id = "app"> {{text}} </ div>

 

Guess you like

Origin www.cnblogs.com/songyan/p/10920943.html