How to create a composable which returns modified path? #2000
Replies: 1 comment 1 reply
-
the route object is readonly, so you can't do return computed(() => ({ ...route, path: route.path.slice(
route.indexOf('/', 1) // everything till the first /
) })) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey guys
Is it possible to create a composable which returns route object but modifies the path property in it?
Obviously this doesn't work
This is the closest solution I could come up with
It seems that i can't write a set method for
path
. I'm doing refactoring and it would be really easy if I could rewrite thepath
property.Sorry guys, I'm not very familiar with proxy in js.
Is there another approach you think might work better?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions