Classification
Interpolation syntax
https://blog.csdn.net/m0_50939789/article/details/128458565
Command syntax
-
v-bind
One-way bindingThe content wrapped in quotation marks is
v-bind:
treated as an expression, and a value can be bound to the quotation marks in any tag.<a v-bind:href="url">关于我</a>
const nav_Vue = new Vue({ el: '#nav_content', data: { url: "./aboutme.html" } })
v-vbind:
abbreviation:
<a :href="url">关于我</a>
Notice:
-
The content inside the quotation marks is an expression
-
Data can only
data
flow from to the page, not from the page todata
-
-
v-model
Two-way bindingUsing
value
the value of the form class, data not only flows fromdata
the to the page, but also from the page todata
v-model: value = "xxx"
The abbreviation since it is mainly used for valuesv-model = "xxx"
of form classesvalue
The difference between the two types of grammar
- Interpolation syntax: tag body content
- Command syntax: label attributes