How to avoid code duplication when running NUXT.js and Axios?

后端 未结 3 1392
悲哀的现实
悲哀的现实 2021-01-22 10:25

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

3条回答
  •  攒了一身酷
    2021-01-22 10:27

    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.

提交回复
热议问题