November 2017
Beginner to intermediate
398 pages
8h 42m
English
For now, we don't have any Vue app running on our web page. The whole library is based on Vue instances, which are the mediators between your View and your data. So, we need to create a new Vue instance to start our app:
// New Vue instancevar app = new Vue({ // CSS selector of the root DOM element el: '#root', // Some data data () { return { message: 'Hello Vue.js!', } },})
The Vue constructor is called with the new keyword to create a new instance. It has one argument--the option object. It can have multiple attributes (called options), which we will discover progressively in the following chapters. For now, we are using only two of them.
With the el option, we tell Vue where to add (or "mount") the instance on our web page ...
Read now
Unlock full access