From 00269941ca892f4bcd34dacb791ae16449afc0f5 Mon Sep 17 00:00:00 2001 From: Amanda Smith <90629384+amandaesmith3@users.noreply.github.com> Date: Tue, 21 Sep 2021 13:08:55 -0500 Subject: [PATCH] docs(router): make root prop docs more descriptive (#23961) --- core/src/components.d.ts | 4 ++-- core/src/components/router/readme.md | 2 +- core/src/components/router/router.tsx | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/src/components.d.ts b/core/src/components.d.ts index 5d729cfb6a4..3d548238011 100644 --- a/core/src/components.d.ts +++ b/core/src/components.d.ts @@ -1936,7 +1936,7 @@ export namespace Components { */ "push": (url: string, direction?: RouterDirection, animation?: AnimationBuilder | undefined) => Promise; /** - * 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; /** @@ -5250,7 +5250,7 @@ declare namespace LocalJSX { */ "onIonRouteWillChange"?: (event: CustomEvent) => 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; /** diff --git a/core/src/components/router/readme.md b/core/src/components/router/readme.md index b48b808c8b5..8ab3561b021 100644 --- a/core/src/components/router/readme.md +++ b/core/src/components/router/readme.md @@ -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` | diff --git a/core/src/components/router/router.tsx b/core/src/components/router/router.tsx index bcb29e3fe4e..5b15779ea78 100644 --- a/core/src/components/router/router.tsx +++ b/core/src/components/router/router.tsx @@ -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 = '/';