N
Nuxtβ€’2mo ago
RicharDVD

Query parameter as default value of ref

Might be a dumb question but I have the following code:
const currentTab = ref(route.query.zakelijk === 'true' ? 1 : 0);
const currentTab = ref(route.query.zakelijk === 'true' ? 1 : 0);
This seems to work fine in development but there are some weird things in production during SSR and I wonder if this could be the culprit. https://www.autoatlas.nl/voorraad/807344313?zakelijk=true. Is route.query not available during SSR? The value of currentTab seems to be right but the template doesn't reflect that. When changing the 'Particulier' and 'Zakelijk' tab it doesn't work and shows the following errors in the console. When removing the query parameter it seems to work fine. Thanks in advance πŸ™‚
Auto Atlas
Auto Atlas
Bekijk de details van de Audi A3 Sportback 30 TFSI|VIRTUAL|19''|LEDER|CRUISE|PDC
No description
1 Reply
Cue
Cueβ€’2mo ago
Looks like a client error, not a server error. And yes, route.query is available on the server. Could be a syncing issue, could be something else in your tab logic.
Want results from more Discord servers?
Add your server