feat(nuxt): handle nuxt route injection for this.$route#27313
feat(nuxt): handle nuxt route injection for this.$route#27313
this.$route#27313Conversation
|
|
danielroe
left a comment
There was a problem hiding this comment.
This looks great - thank you! ❤️
My only worry is that this might have a false positive - e.g. replacing this.$route in a blog post about vue-router. Maybe we could use strip-literal to handle this?
See example here:
nuxt/packages/nuxt/src/core/plugins/tree-shake.ts
Lines 33 to 36 in f209158
|
Should I use |
You lose nothing by doing it first thing after the Magic String creation so why not? Makes sense to me! |
I thought the same, so I implemented it for both cases 🙌 |
this.$route
🔗 Linked issue
Resolves #27272, following up on #21585
📚 Description
Added support for
this.$routein script in options API to ensure that within each suspense fork we have different route objects.