[IMP] router: replace t-routecomponent directive by RouteComponent

closes #287
This commit is contained in:
Géry Debongnie
2019-09-11 13:34:29 +02:00
parent 4fc3423682
commit 471fd49063
10 changed files with 108 additions and 217 deletions
+1
View File
@@ -14,6 +14,7 @@ owl
Observer
router
Link
RouteComponent
Router
store
Store
+6 -6
View File
@@ -8,7 +8,7 @@
- [Route Definition](#route-definition)
- [Router](#router)
- [Navigation Guards](#navigation-guards)
- [`t-routecomponent`](#t-routecomponent)
- [RouteComponent](#routecomponent)
- [Link](#link)
## Overview
@@ -26,8 +26,8 @@ The Owl router support the following features:
- route redirection
- navigation guards
- parameterized routes
- a `<Link>` component
- a `t-routecomponent` directive
- a `<Link/>` component
- a `<RouteComponent/>` component
Note that it is still in early stage of developments, and there are probably
still some issues.
@@ -148,15 +148,15 @@ async function protectRoute({ env, to }) {
A navigation guard is a function that returns a promise, which either resolves
to `true` (the navigation is accepted), or to another destination object.
### `t-routecomponent`
### `RouteComponent`
The `t-routecomponent` directive directs Owl to render the component associated
The `RouteComponent` component directs Owl to render the component associated
to the currently active route (if any):
```xml
<div t-name="App">
<NavBar />
<t t-routecomponent="1"/>
<RouteComponent />
</div>
```