Optional param in vuejs router

后端 未结 3 2122
南旧
南旧 2020-12-13 08:24

I need to route to a certain component in two ways - one with a param, one without. I have searched for optional params and somehow can\'t find much info.

So my rout

3条回答
  •  心在旅途
    2020-12-13 09:18

    For advanced matching patterns the manual says :

    vue-router uses path-to-regexp as its path matching engine, so it supports many advanced matching patterns such as optional dynamic segments, zero or more / one or more requirements, and even custom regex patterns. Check out its documentation for these advanced patterns, and this example of using them in vue-router.

    path-to-regexp page/manual => https://github.com/pillarjs/path-to-regexp/tree/v1.7.0#parameters

提交回复
热议问题