Skip to content
Discussion options

You must be logged in to vote

the route object is readonly, so you can't do reactive(useRoute()) or Object.assign(route, newRoute) like you do. The first solution is closer to what you need to do, it's just not reactive but you could return a computed instead:

  return computed(() => ({ ...route, path: route.path.slice(
	route.indexOf('/', 1) // everything till the first /
) }))

Replies: 1 comment 1 reply

Comment options

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

Answer selected by posva
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants