Vue Programming Fundamentals

First, the context dependent structures:  

  Add Mirror

# After installing node.js, use Taobao mirror 
npm install   -g CNPM --registry = HTTPS: // registry.npm.taobao.org

  Project Initialization

# Global installation vue- cli 
CNPM vue install the -cli - G 

# view the installation vue - cli success 
vue List 

# selected a new path to project the Hello - vue 
vue the init WebPACK " the Hello-vue " 

# install the relevant vue rely 
CNPM install 

# run 
cnpm run dev

 

A, common commands:

  Vue is the MVVM (the Model / View / the ViewModel) of the front-end frame

  1. v-model  used for two-way data binding form elements (ng-model in the same angular)
  2. v-for  format: v-for = "field name in (of) an array of json" loop array or json (ng-repeat in the same angular), note that from the beginning canceled the $ index vue2
  3. v-show  display content (ng-show in the same angular)
  4. v-hide   the hidden content (ng-hide in the same angular)
  5. v-if     show and hide (delete dom elements with angular add ng-if the default is false)
  6. v-else-if   necessary, and v-if used in conjunction
  7. v-else   must be used in conjunction with v-if you can not use otherwise an error template compilation errors alone
  8. v-bind   dynamic binding effect: timely data page changes
  9. v-on: click  to label binding function, may be abbreviated as @, for example, bind a click function function must be written in methods inside
  10. v-text   parse text
  11. v-html    parsing html tags
  12. v-bind: class    three kinds of binding process, the object type '{red: isred}' 2 , three-way type '? isred "red": " blue"' 3, the array type '[{red: "isred" } , {blue: "isblue"} ] '
  13. v-once   only rendered when entering a page is not rendered
  14. v-cloak   preventing flicker
  15. v-pre   put inside the tag output element situ

Guess you like

Origin www.cnblogs.com/kisun168/p/11350060.html