VueJS - Data binding
Vue.js uses a directive syntax that allows you to
declaratively bind the data to the HTML DOM.
All Vue.js directives are valid
HTML that can be parsed by spec-compliant browsers and HTML parsers.
Vue compiles the templates into Virtual DOM render
functions.
Vue is able to check the minimal number of components to re-render and apply the minimal
amount of DOM manipulations when the app state changes.
Types of binding
Text binding:
This types of binding
is for text interpolation using {{ }} syntax. It gets updated whenever the
values of “empname”, “department” changes.
VueJs data binding examples
Employee name : {{empname}}
HTML binding:
{{ }} interprets the data as plain text, not HTML. In order
to parse HTML, you will need to use the v-html directive.
VueJs data binding examples
{{htmlcontent}}
Attribute binding:
v-html or {{ }} cannot be used for attributes, for attribute
binding v-bind directive is used.
VueJs data binding examples