Answer the question
In order to leave comments, you need to log in
How to reuse Vue components?
For example, we have a table component, in the header of which there is a button for adding an element. There are several tables in the application, each, when adding a new element through a button, must add this element through different api methods to different database tables. Can this be done and how?
Answer the question
In order to leave comments, you need to log in
The component generates an event, the parent subscribes to it by assigning its handler. Thus, in each specific case, the handlers can be different and the same component becomes universal. See example :
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question