![]() ![]() ![]() Like we’ve seen over and over again, it is a method that returns an object, and inside that object, we define all the variables we need for this component instance. Data options dataįirst of all, the data method. The data method is a method where we declare a list of variables that we are going to use in the component instance, and data options is a collection of properties and methods that deals with data in Vue.js, which includes the data method.Īfter that, we are going to discuss the lifecycle hooks, which are interfaces that allow us to inject codes at different stages of a component instance’s creation. Do not confuse data options with the data method we talked about before. In this article, we are going to talk about several different types of data options. To master a web framework, the most important step is to understand how data could circulate inside your project, and how different types of data are treated differently. Now, it is finally time for us to dive into the most important part of this course, the script section of a Vue application. We can use it to specify what kind of event we are listening to, and what kind of action we are going to take after this event has been received. The v-on directive, which we can shorten to just the symbol, is used to listen to events in Vue.js. If you are not familiar with what an event is, there is a detailed explanation here: JavaScript Basics The event handler listens to that event and it would perform some actions in the background and return something as the response. And before we could start talking about the script section of Vue.js, we are going to quickly go through style bindings, and class bindings.Īn event is a user input, it could be a keyboard input or a mouse click, the user would usually expect some kind of response after the event takes place. In this article, we are going to focus on two aspects, event handling with the directive v-on, and form input handling with the directive v-model. Event handlingįrom our course on JavaScript basics, we learned that event handling is the most important concept in frontend development, and Vue.js, being a JavaScript frontend framework must have the same concept built in. ![]() Previously, we talked about some basic concepts in Vue, and in this article, we are going to dig deeper into this JavaScript framework, and event handling, data options, and components. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |