One of the challenges I am facing is passing value parameters in my URL with the mounted function looking like this:
mounted () {
this.$router.push({
path: '/activatewithphone',
query: { serial: this.$route.params.serial, machine: this.$route.params.machine }
})
},
In my computed properties, I retrieve the values as follows:
computed: {
serial () {
return this.$route.query.serial
},
machine () {
return this.$route.query.machine
}
},
When trying to access the serial and machine values using this.serial and this.machine
, it returns undefined
.
The issue arises when a user visits a URL like
example.com/activatewithphone?serial=sddsdsds&machine=sdsdsd
, and it redirects back to example.com/activatewithphone
.
These values are dynamic and part of the functionality of the app. The main idea behind the app is that a user clicks on a desktop link to activate their account. This link includes parameters (serial and machine) in the URL which launches a browser. The user then enters a form number and makes a payment on the web. The reference code is sent back to the backend along with the serial and machine sent with the URL.