March 2018
Beginner to intermediate
344 pages
7h 7m
English
When we add a variable to our data object, we're essentially creating a reactive property that updates the view any time it changes. This means that, if we had a data object with a property named firstName, that property would be re-rendered on the screen each time the value changes:
<!DOCTYPE html><html><head> <title>Vue Data</title> <script src="https://unpkg.com/vue"></script></head><body> <div id="app"> <h1>Name: {{ firstName }}</h1> <input type="text" v-model="firstName"> </div> <script> const app = new Vue({ el: '#app', data: { firstName: 'Paul' } }); </script></body></html>
This reactivity does not extend to objects added to our Vue instance after the instance has been created outside of the data object. If we had another ...
Read now
Unlock full access