Data Binding and Interpolation
up:: Vue
const app = Vue.createApp({
data() {
return {
courseGoal: "Finish course!"
};
}
});
app.mount('#app');
Now courseGoal
is available anywhere on the #app
element:
<p>{{ courseGoal }}</p>
Vocabulary
This is called interpolation.
Warning
This only work between html tags. To set the attribute on a html tag, you need to use v-bind.