Vue.js practice (a)

1. Direct analysis on the source code:

     

important point:

. (1) references to support VUE running runtime: src = "https://cdn.staticfile.org/vue/2.2.2/vue.min.js"

(2) In the <script> </ script> tag defined syntax vue template, element definitions, data mode and the like.

(3) In the <div> </ div> tag, reference vue syntax defined. Put the div id tag and tag el vue in association.

(4) In the label p {} brackets, body Vue of reference data. Vue in the message and the message div is associated.

2. Simple and user interaction to complete the vue

v-on: special instruction Vue is capable of recognizing its role is to tell Vue listen for certain events.

important point:

(1). V-on is vue instructions can listen changeTitle changes.

(2). Function is a method of native javascript.

Non-text files can be bound label attributes by v-bind.

3. What are the instructions:

Substantially instruction code is indicated on a number.

v-once data indicative of the instruction is only rendered once, then not modified. v-once allows content remains at the initial value.

Vue will default escape html code, it does not say that rendered HTML element, but the output is plain text.

If you want to output HTML element, rather than plain text, how to do it. v-html instructions may be employed. The following format:

The instructions on where you want to output HTML code. This directive is followed by V-html attributes, in fact, html code. The role of the instruction is to tell VUE to render HTML code instead of transferring it (now generally used v-bind to the binding)

 

 

 

 

 

Guess you like

Origin blog.csdn.net/weixin_40876986/article/details/90512724