Categories
Vue Answers

How to get URL query with Vue.js?

Spread the love

Sometimes, we want to get URL query with Vue.js.

In this article, we’ll look at how to get URL query with Vue.js.

How to get URL query with Vue.js?

To get URL query with Vue.js, we can use the this.$route.query property if we have Vue Router.

For instance, we write

this.$route.query.page

to get the page query parameter’s value in our Vue component.

Conclusion

To get URL query with Vue.js, we can use the this.$route.query property if we have Vue Router.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *