VueJs get url query

I think you can simple call like this, this will give you result value. this.$route.query.page Look image $route is object in Vue Instance and you can access with this keyword and next you can select object properties like above one : Have a look Vue-router document for selecting queries value : Vue Router Object

Apply global variable to Vuejs

Just Adding Instance Properties For example, all components can access a global appName, you just write one line code: Vue.prototype.$appName=”My App” or in vue3 app.config.globalProperties.$http = axios.create({ /* … */ }) $ isn’t magic, it’s a convention Vue uses for properties that are available to all instances. Alternatively, you can write a plugin that includes … Read more

How do I format currencies in a Vue component?

I have created a filter. The filter can be used in any page. Vue.filter(‘toCurrency’, function (value) { if (typeof value !== “number”) { return value; } var formatter = new Intl.NumberFormat(‘en-US’, { style: ‘currency’, currency: ‘USD’ }); return formatter.format(value); }); Then I can use this filter like this: <td class=”text-right”> {{ invoice.fees | toCurrency }} … Read more

Vue.js – Making helper functions globally available to single-file components

inside any component without having to first import them and then prepend this to the function name What you described is mixin. Vue.mixin({ methods: { capitalizeFirstLetter: str => str.charAt(0).toUpperCase() + str.slice(1); } }) This is a global mixin. with this ALL your components will have a capitalizeFirstLetter method, so you can call this.capitalizeFirstLetter(…) from component … Read more