I can create a constant through a store in my vuejs application, but i don't think it is a good practice.what is other way to do the same?
相关问题
- Axios OPTIONS instead of POST Request. Express Res
- Vue.js - set slot content programmatically
- Simple vue app doesn't show anything
- Getting Uncaught TypeError: …default is not a cons
- Vue.js computed property loses its reactivity when
相关文章
- VUE的v-for中深入响应式原理的问题
- Best way to dynamically change theme of my Vue.js
- vue-router how to persist navbar?
- How to Properly Use Vue Router beforeRouteEnter or
- Difference between nameFunction() {} and nameFunct
- Vue - best way to reuse methods
- setTimeout() not working called from vueJS method
- How to unbind an array copy in Vue.js
You can always define a variable outside of the Vue app scope and use it throughout the application.
However, if you are using any bundler like Webpack/Browserify/etc. you can do the same but you'd have to import it into every component using it. An example for that can be found below.
You can use the method
or
try this instead