Closed xiaohulu closed 4 years ago
May be, route config should be nested router.
{
"path": "tree",
"outlet": "view-tree-root",
"children": [
{
"path": "*",
"outlet": "view-tree-children"
}
]
}
which can partial refresh the tree part.
Enhancement
Package Version: 5.0
I want design a REST API
{owner}/{project}/tree/{branch}/*
to view the folder structure.{owner}/{project}/tree/{branch}
to getfolder1
{owner}/{project}/tree/{branch}/folder1
to getfolder2
{owner}/{project}/tree/{branch}/folder1/folder2
to getfolder3
It is similar to github's repo url.
Code
I use router config like below first
folderPathes
can be empty or null, 'folder1', 'folder1/folder2' which contains/
But the router can not switch '{owner}/{project}/tree/{branch}/folder1' to '{owner}/{project}/tree/{branch}/folder1/folder2'
may be here do a check
https://github.com/dojo/framework/blob/master/src/routing/Router.ts#L244
because
route.segments
length is greater thanparams
lengthSo I expect to support wildcard like this
Expected behavior:
*
can be zero or more segmentstree
, not include the ending/
tree/folder1
tree/folder1/folder2