Vue among the four kinds of instructions and its use

1, v-if: determine whether to hide

2, v-for: Data loop

3, v-bind: class: a binding property

4, v-model: to achieve two-way data binding

The difference here highlights a v-if's and v-show:

Common: all data by determining the binding of true / false to show the

Differences: v-if determined to be true only when the data will be rendered, if it is false to delete the code. Unless data is rendered again, v-if only to re-determine. It can be said to be more inclined to use the data in one operation.
    v-show is that no matter what the judge will first render the data, but false when the nodes display: none; operation. So the case of re-rendering the data do not change the value of the data so that the data can show or hide

Guess you like

Origin www.cnblogs.com/rabbitstudent/p/11723143.html