Answer the question
In order to leave comments, you need to log in
How to declare a global variable in Vue js and work with it?
App.js has a div class with v-bind:class="{ ' appRootModal': isModal }" and the isModal variable is naturally created. How to work with it in other components. That is, when the modal opens, the isModal variable must also change. I know and use variables about passing variables to components, but here I need to pass them to the main component. As one of the options, use Vuex, but I think everything is much easier to use here. Something like this.$root.isModal = true;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question