How to use same methods in different componenets

Hello everyone i am new to vuejs i need help how to use same methods in different components
I have defined 5 api calls methods in one component but i need same methods in another component also how to do this can anyone help?

It depends, How you have structured your application and what is the isolation of the methods.

You can use the functions as Mixin, Provide-inject, or if you are using a Vuex you can shift your functionality to store actions.
Even you can create a utility File with exporting the functions, this is useful when functions does not need any context.

Thanks prabhat903 for reply
Can you please suggest me some example of Mixin because i never work on it or with actions in vuex

Hello @Lekhrajk,

Mixins are objects just like your component object and may have all elements like computed, methods even all your life cycles.

and The this will always refers to the component where mixin merged. follow the Vue documentation for more understanding.

and Here is an example link.

Hope able to help you.

Thank you @prabhat903
I will try and get back to you if any doubt