-
Book Overview & Buying
-
Table Of Contents
Front-End Development Projects with Vue.js
By :
Interpolation is the insertion of something of a different nature into something else. In the Vue.js context, this is where you would use mustache syntax (double curly braces) to define an area where you can inject data into a component's HTML template.
Consider the following example:
new Vue({
data() {
title: 'Vue.js'
},
template: '<span>Framework: {{ title }}</span>'
})
The data property title is bound to Vue.js reactive data and will update on the fly depending on state changes to the UI and its data. We will go into more depth about how to use interpolation and how to bind it to data properties in the next exercise.
When you want to output data into your template or make elements on a page be reactive, interpolate data into the template by using curly braces. Vue can understand...
Change the font size
Change margin width
Change background colour