You could try using nextTick()
mounted() {
Vue.nextTick()
.then(function () {
console.log(this.$route.query);
})
}
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have this url above on first load
http://domain.test/?access_token=value&refresh_token=value&platform=Android&reseller=value&reseller_account=value
and on my vuejs file
mounted() {
console.log(this.$route.query);
},
its giving me null
but
beforeRouteEnter (to, from, next) {
let data = {
accessToken: to.query.access_token,
refreshToken: to.query.refresh_token,
reseller: to.query.reseller,
resellerAccount: to.query.reseller_account
};
}
does give me values though..
I want to get the value on first load
I found the issue, it was my mistake. looks like I was deleting the properties of it on another component. it took me quite a while to find it because there are too many component files.
Please or to participate in this conversation.