Vue common commands summary

This paper describes the process used Vue, some common instructions.

First use Vue, must be introduced vue, (html page) introduced way:
here is a reference to online vue file can be downloaded directly to a local reference
Here Insert Picture Description
1. Create vue instantiate an object
to be used vue, vue to declare a new object, and create vue examples of the target region:
Here Insert Picture Description
2.v-ON: the method of binding the tag event, a shorthand way of @
V-ON can bind any attribute, such as mouse events and keyboard events and other operations
may be added event modifier, a combination of keys used to implement effect
Here Insert Picture Description
3.v-bind: attribute tag binding method, a shorthand way :
V-binding properties of the bind properties can coexist and before
Here Insert Picture Description
4.v-text and v-html: data replacement method
of the replacement tag content, V- text covers only text
v-html tag may parse
RenderingsHere Insert Picture Description
5.v-for data traversal method
Here Insert Picture DescriptionHere Insert Picture Description
6.v-if expression is true or false judgment, whether to show whether to hide the true and false in accordance with the result, if false, the hidden element
here the hide is removed from the code directly element (the element is removed)
Here Insert Picture Description
7.v Show-determination expression is true, and v-if similar usage, hide the display here: none properties Hide
not meta Delete (elements still)
Here Insert Picture Description
8.v-Model two-way data binding instructions
when used in the location of the form, input boxes and other elements, to get their data as well as data submitted by the
need to use v-model
Here Insert Picture Description

Released three original articles · won praise 2 · Views 100

Guess you like

Origin blog.csdn.net/weixin_39282845/article/details/104591749