Skip to content

How to use inertia SSR route() in setup #564

Answered by bakerkretzmar
drivedemon asked this question in Q&A
Discussion options

You must be logged in to vote

Your setup looks correct to me, but in setup() there's no this so you can't use the mixin. Since Ziggy 1.4.4 though the route function is also injected everywhere by the plugin, so you should be able to use it in setup() like this:

setup() {
  const route = inject('route');
  // etc.
}

Let me know if that works! See also:

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@bakerkretzmar
Comment options

@drivedemon
Comment options

Answer selected by drivedemon
Comment options

You must be logged in to vote
0 replies
Comment options

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #563 on May 26, 2022 14:29.