If similar code (as in the example) is duplicated in different components but with slight differences in the name of what I pass in the function parameters
What a
We can do it by mixins. Make a js file inside mixins folder and put this function there and add this mixin file in vue files to use this function.