-
Book Overview & Buying
-
Table Of Contents
JavaScript from Frontend to Backend
By :
We have seen how to create reactive variables in a component, using the data section of the component. It is also possible to create methods in a component that can be used in the component template.
There are two ways to add methods to a component:
methods section of the component.computed section of the component.Let’s look at these two ways to do it.
For each incrementation of the counter, it should be necessary to display the time at which it occurs. A time() function would be very useful in the component, allowing us to display the time in the form HH:MM:SS. This time() function will be defined in the methods section of the component.
The <counter> component is modified to integrate the display of the time at the beginning of the line. We can...