Reader small image

You're reading from  JavaScript from Frontend to Backend

Product typeBook
Published inJul 2022
Reading LevelBeginner
PublisherPackt
ISBN-139781801070317
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Eric Sarrion
Eric Sarrion
author image
Eric Sarrion

Eric Sarrion is a trainer and a developer as an independent consultant. He has been involved in all kinds of IT projects for over 30 years. He is also a long time author in web development technologies and is renowned for the clarity of his explanations and examples.
Read more about Eric Sarrion

Right arrow

Assembling components

Vue.js divides an application into a set of components. These components are then assembled to form the final application.

Let’s study an example of how to create components and then assemble the created components. The goal is to use three counters (associated with three input fields) like the one in the previous example, then display the total of these counters. The total updates, as numbers are typed into each of the input fields.

We will create two components for this:

  • The <counter> component is used to manage a counter.
  • The <counters> component allows you to manage the three counters together and display the total.

The index.html file will display the <counters> component in its template section:

index.html file

<html>
  <head>
    <meta charset="utf-8" />
    <script src="https://unpkg.com/vue@next"></script...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
JavaScript from Frontend to Backend
Published in: Jul 2022Publisher: PacktISBN-13: 9781801070317

Author (1)

author image
Eric Sarrion

Eric Sarrion is a trainer and a developer as an independent consultant. He has been involved in all kinds of IT projects for over 30 years. He is also a long time author in web development technologies and is renowned for the clarity of his explanations and examples.
Read more about Eric Sarrion