Interpolations
Text Interpolation
You can use "mustaches" (double curly braces) inside the template for text interpolation. For example:
You can use simple JavaScript expressions inside the mustaches, for example {{ number + 1 }}
.
Binding Attributes
You can use the v-bind
directive to bind dynamic values to attributes, for example:
The v-bind
directive binds the data property, or the result of an expression, to the attribute specified after the colon. In this example, the title of the window will be "Hello!". When the value of the title
property is changed, the title of the window is automatically updated.
The v-bind
directive can be applied to many different attributes. In case of boolean attributes, the null
, undefined
and false
values are interpreted as false and other values are interpreted as true.
You can use simple JavaScript expressions in bound attributes, for example:
You can also use the shorthand syntax by omitting v-bind
and prefixing the attribute name with a colon, for example:
Last updated