VUE learning Diaries 2

v-show
effect, according to the value of the data expressed later, the switching element display attributes show and hide.
v-show can later with expression
Here Insert Picture Description
Here Insert Picture Description
v-if
effect, the expression pattern of true and false, and the hidden display elements switch (actuating element dom)
Use as v-show
Here Insert Picture Description
V the bind-
add properties, etc. dom element operative to
three yuan operator may be converted to the form of the object (class name is determined:? empty) = "class name: bool as shown in FIG
v-bind: class =" class name "==: class =" class name "
Here Insert Picture Description
Here Insert Picture Description
page switching
Here Insert Picture Description
due CSS layout unskilled can not make more beautiful pages
Here Insert Picture Description
v-for
v-Vue for a loop through the object in the array can be used to create multiple tag
has the following syntax diagram
Here Insert Picture Description
Here Insert Picture Description
can delete data by adding an array of functions, while the page is responsive the data will also render up to dom

v-on to add
v-on event can be bound into a school function call, passing custom parameters.
Here Insert Picture Description
Figure above is fed to the two fan function data, and a second sentence was triggered by a key restriction, if there is no limit for each input word will then outputs
Here Insert Picture Description
v-model
for setup form data together with the actual data (two-way data binding)
when we modify any of the data, the data will follow another modification, reflecting responsive framework.
Here Insert Picture Description
Simple code
Here Insert Picture Description

Published 17 original articles · won praise 1 · views 3423

Guess you like

Origin blog.csdn.net/weixin_43983570/article/details/105207502