4👍
✅
Every vue component is an instance of Vue. When you define a variable (such as $someHeight) on Vue’s prototype, all new components created will get their own copy of such variable.
Which means every Vue component will have its own copy of $someHeight with value of 200. Now even if you set its value to 300, all other components will have the old value of 200.
It is not a good practice. You should only define functions on prototype: Vue doc
Now you can either use Vuex for this or create a global vue instance and use it to store your global variables. Vuex recommended of-course!
Source:stackexchange.com