The advantage of Vue.js over Angular or React in terms of performance, ease of use and scalability:
• Best for native as well as web development.
• Overall memory allocation per MB in loading framework libraries in Vue.js is less compare to Angular 1.x and Angular 2.0.
• Directly manipulate DOM elements. ReactJS create virtual DOM and then manipulate it. Even after using actual DOM Vue.js is faster.
• Vue.js is much simpler than Angular 1, both in terms of API and design. Learning enough to build non-trivial applications typically takes less than a day, which is not true for Angular 1.
OK, so we look out how we can set up it in our project.
First, install node.js in your system. It provides node package manager which helps to install Vue.js-
# latest stable
$ npm install vue
The Vue Instance
The entry point of every Vue application is created via an instance. The instance then configures the rest of the application and can drill into child members while your application scales up. This is how one would look like:
// Vue instance
// Element to attach the app
// on the DOM
// Bindable data
message: 'Welcome to Habilelabs!',
OK so here el indicates that on which element it should be mounted on and it uses with prefix #
So here is the HTML portion
Due to reactive binding we can display data here.
Hope you enjoyed this Vue.js Introduction. Share this with your friends on Facebook.