Pretty simple question, I am pushing a named route like so:
this.$nuxt.$router.push({ name: "my-named-route-id-foo", params: { id: this.$route.params.id } });
But I want to conditionally add a prefix to this so instead of the resulting URL always going to:
/my-named-route/32/foo
It might go to:
/prefix/my-named-route/32/foo
How do I insert the 'prefix' without resorting to a path route? (because I need to pass params on some of them and I don't want to use a query i.e. ?param=blahblah
)
I'm assuming it's probably using a custom middleware function, but I'm just not what to use to achieve what I want.