Skip to content

No reason to use the Vue plugin if you're using @routes blade directive? #656

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

You must be logged in to vote

To use the route() function inside your Vue component <template> tags you need the Vue plugin (or you need to recreate its functionality yourself), because the templates are compiled and can't access the global browser scope.

The IDE (JetBrains stuff, at least) doesn't know about route() with either the plugin or the @route directive. It shows as an error either way, but it always works anyway.

I don't know about JetBrains specifically and this depends a lot on where exactly you're talking about. Inside a component <template>, using the Vue plugin, the IDE should be able to tell that the route() function exists. In a component <script> you have to const route = inject('route');, althoug…

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Smef
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants