Your examples are misleading as that is not the correct way to construct and load a Vue plugin
Can you provide a working/correct example?
I'm not sure what you mean. Could you explain?
It's not claiming to be a 'plugin'. But if you want to attach a utill, he says it's fine to use the base lib and just attach it to the prototype. And I tend to agree in the case of Axios.
Vue.use() just checks if it wasn't already registered and calls the install() method. And in the docs (vuejs.org/v2/guide/plugins.html) is mentioned; "want to bind something to the instance?" -> Vue.prototype.$myMethod = ....
Vue.prototype.$myMethod = ...
So I would argue there isn't a big difference. Just use it with care.
We’re a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.