Leveraging Computed Properties and Methods in Vue.js
In the previous chapter, we learned about Vue directives and spent most of our time in the <template>
section of our component. In this chapter, we are going to move our focus to the <script>
tag and learn how to ensure that the logic of our component is abstracted.
This chapter aims to introduce you to two features: methods and computed. These Vue.js features are essential to ensuring that your component logic remains performant and readable. We will go over the components that we created in previous chapters and use the preceding techniques to make them easier to read. Throughout the chapter, we will also continue to add further details to features that we have learned about in previous chapters, such as Refs variables and directives.
This chapter is going to be broken down into the following sections:
- Abstracting functionality using methods
- Creating dynamic data using computed properties
- Learning...