Book Image

Vue.js 2 Cookbook

By : Andrea Passaglia
Book Image

Vue.js 2 Cookbook

By: Andrea Passaglia

Overview of this book

Vue.js is an open source JavaScript library for building modern, interactive web applications. With a rapidly growing community and a strong ecosystem, Vue.js makes developing complex single page applications a breeze. Its component-based approach, intuitive API, blazing fast core, and compact size make Vue.js a great solution to craft your next front-end application. From basic to advanced recipes, this book arms you with practical solutions to common tasks when building an application using Vue. We start off by exploring the fundamentals of Vue.js: its reactivity system, data-binding syntax, and component-based architecture through practical examples. After that, we delve into integrating Webpack and Babel to enhance your development workflow using single file components. Finally, we take an in-depth look at Vuex for state management and Vue Router to route in your single page applications, and integrate a variety of technologies ranging from Node.js to Electron, and Socket.io to Firebase and HorizonDB. This book will provide you with the best practices as determined by the Vue.js community.
Table of Contents (19 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Dedication
Preface

Transitioning on the initial render


With the appear keyword, we are able to package transition for elements when they are first loaded. This helps the user experience in that it gives the impression that the page is more responsive and faster to load when you apply it to many elements.

Getting ready

This recipe doesn't assume any particular knowledge, but if you have completed at least the Adding some fun to your app with CSS transitions recipe, it will be a piece of cake.

How to do it...

We will build a page about the American actor Fill Murray; no, not Bill Murray. You can find more information about him at http://www.fillmurray.com. We will use images from this site to fill our page about him.

In our HTML, let's write a header as the title of our page:

<h1> 
  The Fill Murray Page 
</h1>

After the title, we will place our Vue application:

<div id="app"> 
  <img src="https://fillmurray.com/50/70"> 
  <p> 
    The internet was missing the ability to 
    provide custom...