vuejs / router

🚦 The official router for Vue.js
https://router.vuejs.org/
MIT License
3.84k stars 1.18k forks source link

open matcher in router object #2066

Closed suningkooboo closed 9 months ago

suningkooboo commented 9 months ago

What problem is this solving

We are trying to support two kinds of page URLs without prefix

So any wildcard pages need to dynamic try the match in product categories, fallback to wildcard content pages if not matched.

I plan to change matcher behavior a bit but it's not opened in router object in latest 4.2.5 version (I use Nuxt3).

BTW I successfully did above feature before in Nuxt2 with old vue-router version.

Proposed solution

In createRouter return { currentRoute, matcher, ... }

Describe alternatives you've considered

No response