Book Image

The Majesty Of Vue.js

By : Alex Kyriakidis, Kostas Maniatis
Book Image

The Majesty Of Vue.js

By: Alex Kyriakidis, Kostas Maniatis

Overview of this book

<p>Vue.js is a library to build interactive web interfaces. The aim is to provide the benefits of reactive data binding and composable view components with an API that is as simple as possible.</p> <p>This book will teach you how to efficiently implement Vue.js in your projects. It starts with the fundamentals of Vue.js to building large-scale applications. You will find out what components, filters, methods, and computed properties are and how to use them to build robust applications.</p> <p>Further on, you will become familiar with ES6, single file components, module bundlers, and workflow automation. The best way to learn to code is to write it, so there’s an exercise at the end of most of the chapters for you to solve and actually test yourself on what you have learned. You can solve these in order to gain a better understanding of Vue.js.</p> <p>By the end of this book, you will be able to create fast front-end applications and increase the performance of your existing projects with Vue.js integration.</p>
Table of Contents (23 chapters)
The Majesty of Vue.js
Credits
About the Authors
www.PacktPub.com
Preface
2
Getting Started
8
Consuming an API – Preface
12
ECMAScript 6
15
Swapping Components
18
Closing Thoughts

Compiling ES6 with Babel


Babel will be our middleman. Babel is a source-to-source JavaScript compiler, which lets us use next generation JavaScript, today.

Note

A source-to-source compiler, transcompiler or transpiler, is a type of compiler that takes the source code of a program written in one programming language, as its input, and produces the equivalent source code in another programming language.

Babel

Before installing Babel, you have to install Node.js. To do so, head to Node's website (https://nodejs.org/en/) and hit the download button for the the latest stable version. It is going to give you a .pkg file (or .msi if you are on Windows). When the download is finished, open the file and follow the instructions. Then, do the required restart, and you are done!

Node.js

Installation

Create a new directory and place a file named package.json inside, containing an empty JSON object ({}). You can do it manually or by running the following commands in your terminal:

mkdir babel-example
echo...