Skip to content
Discussion options

You must be logged in to vote

Composables are meant to be used inside of setup(). That's the textbook definition of them. What you are doing is trying to use them outside of setup() so that's why it's no wonder it doesn't works as you expect. It's like trying to use a composable in a plain js file.

The "router" is not passed to Quasar CLI's preFetch hook because: 1) it doesn't makes any sense to be using it there and (more aggravating) 2) it allows devs to make mistakes like assuming they can redirect to another page using it -- which would break the boot procedure from every angle. So there's "currentRoute", "previousRoute" and "redirect" method there.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@CharlieBrownCharacter
Comment options

Answer selected by rstoenescu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants