@which-route/matcher

0.1.7 • Public • Published

@which-route/matcher

match a url to vue router path

install

yarn add @which-route/matcher

usage

const match = require('@which-route/matcher')

const routes = [{
  path: '/a',
  children: [{
    path: 'b/:id'
  }]
}]
const url = '/a/b/1'
const res = match(routes, url)

console.log(res)
  • result: '/a/b/:id'

Readme

Keywords

none

Package Sidebar

Install

npm i @which-route/matcher

Weekly Downloads

1

Version

0.1.7

License

MIT

Unpacked Size

2.7 kB

Total Files

4

Last publish

Collaborators

  • tangruijia