Skip to content

Commit

Permalink
docs(router): make root prop docs more descriptive (#23961)
Browse files Browse the repository at this point in the history
  • Loading branch information
averyjohnston authored Sep 21, 2021
1 parent e483034 commit 0026994
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1936,7 +1936,7 @@ export namespace Components {
*/
"push": (url: string, direction?: RouterDirection, animation?: AnimationBuilder | undefined) => Promise<boolean>;
/**
* By default `ion-router` will match the routes at the root path ("/"). That can be changed when
* The root path to use when matching URLs. By default, this is set to "/", but you can specify an alternate prefix for all URL paths.
*/
"root": string;
/**
Expand Down Expand Up @@ -5250,7 +5250,7 @@ declare namespace LocalJSX {
*/
"onIonRouteWillChange"?: (event: CustomEvent<RouterEventDetail>) => void;
/**
* By default `ion-router` will match the routes at the root path ("/"). That can be changed when
* The root path to use when matching URLs. By default, this is set to "/", but you can specify an alternate prefix for all URL paths.
*/
"root"?: string;
/**
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/router/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ In order to configure this relationship between components (to load/select) and

| Property | Attribute | Description | Type | Default |
| --------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ------- |
| `root` | `root` | By default `ion-router` will match the routes at the root path ("/"). That can be changed when | `string` | `'/'` |
| `root` | `root` | The root path to use when matching URLs. By default, this is set to "/", but you can specify an alternate prefix for all URL paths. | `string` | `'/'` |
| `useHash` | `use-hash` | The router can work in two "modes": - With hash: `/index.html#/path/to/page` - Without hash: `/path/to/page` Using one or another might depend in the requirements of your app and/or where it's deployed. Usually "hash-less" navigation works better for SEO and it's more user friendly too, but it might requires additional server-side configuration in order to properly work. On the other side hash-navigation is much easier to deploy, it even works over the file protocol. By default, this property is `true`, change to `false` to allow hash-less URLs. | `boolean` | `true` |


Expand Down
5 changes: 2 additions & 3 deletions core/src/components/router/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ export class Router implements ComponentInterface {
@Element() el!: HTMLElement;

/**
* By default `ion-router` will match the routes at the root path ("/").
* That can be changed when
*
* The root path to use when matching URLs. By default, this is set to "/", but you can specify
* an alternate prefix for all URL paths.
*/
@Prop() root = '/';

Expand Down

0 comments on commit 0026994

Please sign in to comment.