@fruit-ui/router 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/router.js +0 -1
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ const myRouter = router.Router(
|
|
|
37
37
|
|
|
38
38
|
## The `navigate` function
|
|
39
39
|
|
|
40
|
-
The `navigate` function takes in a path and navigates to that path. Navigation is done with `history.pushState` so it is compatible with the browser forward/back methods. You can navigate to hashed paths (i.e., `navigate('/about#contact')`) to automatically scroll to a certain element ID, depending on scroll settings.
|
|
40
|
+
The `navigate` function takes in a path and navigates to that path. Navigation is done with `history.pushState` so it is compatible with the browser forward/back methods. You can navigate to hashed paths (i.e., `navigate('/about#contact')`) to automatically scroll to a certain element ID, depending on scroll settings.
|
|
41
41
|
|
|
42
42
|
`navigate` also takes an optional object `searchParams` representing any other search params to be used.
|
|
43
43
|
|
package/package.json
CHANGED
package/src/router.js
CHANGED
|
@@ -136,7 +136,6 @@ function navigate(page, searchParams = {}) {
|
|
|
136
136
|
hash = page.slice(page.indexOf('#'));
|
|
137
137
|
page = page.slice(0, page.indexOf('#'));
|
|
138
138
|
}
|
|
139
|
-
if (page === getPage()) return;
|
|
140
139
|
const url = new URL(window.location.href);
|
|
141
140
|
url.search = '';
|
|
142
141
|
url.searchParams.set(PARAM_NAME, page);
|