Getting started with VUE (template syntax) (2)

template syntax

Effect

1. Interpolation syntax (parsing tag body)

insert image description here
insert image description here

2. Instruction syntax (parsing tags)

insert image description here
insert image description here

v-bind (shorthand: )

Put the url into the data
insert image description here
and found the original wording error
insert image description here

Correct way of writing
At this time, the url in the quotation marks is executed as a js expression
insert image description here

At this time, the display is normal
insert image description here
. When the bound expression does not exist in the data, an error will be reported.
insert image description here
insert image description here
Although there are two identical names in the data, an
insert image description here
error will not be reported at this time, but it is not what we want to express. The name is all overwritten by the last one. So
insert image description here
continue to put the object type (that is, nesting doll) in the data
insert image description here
so that we can achieve the effect we want
insert image description here

Getting Started with VUE (Super Meticulous) (1)
Getting Started with VUE (Template Syntax) (2)

Guess you like

Origin blog.csdn.net/qq_43010602/article/details/122098803
Recommended