vuejs / router

🚦 The official router for Vue.js

Home Page:https://router.vuejs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

open matcher in router object

suningkooboo opened this issue · comments

What problem is this solving

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

  • product category for example before is /product/list/xxxx now is /xxxx
  • wildcard content pages.

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