0

Under the hood, I understand the vue-router uses path-to-regexp to handle route matching.

If I use the route format:

/app/:collection(/^cases$?)/:id 

This matches the route /app/cases/abc123 and directs to the component just fine but doesn't store { collection: 'cases' } on the $route.params object which is what I also need. Is there another way to do this?

1 Answer 1

1

My bad, I misunderstood the syntax of path-to-regexp in the docs.

The route matching should have been:

/app/:collection(cases)/:id

.. then you get the route matching with the parameter passed.

I'm unclear if its appropriate to answer the question as correction or delete it. I'm sure someone will let me know ;)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.