Some technical information at the beginning:
- tutorial is written in Vue.js, version 2.2.1
- there is used ES6 multiline string feature with back-tick notation
- examples will be available in JSFiddle to see it directly in action
- Twitter Bootstrap 4 is used to make app nicely styled
- if you use Vue CLI and single-file components, don’t worry, in the final, bonus part of the tutorial, you find rewritten app, downloadable source code attached, using webpack-simple template
What Is the App About?
Imagine school with 2 classes. You are the director, who decides which class is suitable for each student.
You will be able to:
- assign student to the classes
- switch student from one class to another
- return student to school (without class assignment)
- if student has bad results, but really bad, you can say goodbye
- accept new students
- see statistics, how many students are at school, and in each class
Live Vue.js Tutorial Preview
This tutorial is focused on components, but as you can see from the preview, many other Vue.js features are used, e.g.:
- string interpolation
- two-way data binding
- watching property
- lifecycle “created” hook
- loop “v-for” with index used
- click event (in shorthand syntax)
Finally, while mentioning two-way data binding, there is a big difference to components. Each type of communication (parent to child, child to parent, child to child) is one-way.
There is nothing as simple as data “v-model”, each communication flow has to be declared separately.