@budarin/use-route 1.0.1 → 1.0.3
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 +6 -2
- package/demo/node_modules/.bin/browserslist +21 -0
- package/demo/package.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,9 +21,10 @@
|
|
|
21
21
|
[](https://bundlephobia.com/result?p=@budarin/use-route)
|
|
22
22
|
[](https://github.com/budarin/use-route)
|
|
23
23
|
|
|
24
|
-
**Живое демо:**
|
|
24
|
+
**Живое демо:** запуск в браузере без установки; исходники в папке [demo/](https://github.com/budarin/use-route/tree/master/demo).
|
|
25
25
|
|
|
26
|
-
[
|
|
26
|
+
- [Open in StackBlitz](https://stackblitz.com/github/budarin/use-route/tree/master/demo)
|
|
27
|
+
- [Open in CodeSandbox](https://codesandbox.io/p/sandbox/github/budarin/use-route/tree/master/demo)
|
|
27
28
|
|
|
28
29
|
## ✨ Особенности
|
|
29
30
|
|
|
@@ -447,12 +448,15 @@ function DashboardSection() {
|
|
|
447
448
|
<div>
|
|
448
449
|
{/* При URL /dashboard/reports pathname === '/reports' */}
|
|
449
450
|
<p>Раздел Dashboard. Путь: {pathname}</p>
|
|
451
|
+
|
|
450
452
|
<button type="button" onClick={() => navigate('/reports')}>
|
|
451
453
|
Отчёты → /dashboard/reports
|
|
452
454
|
</button>
|
|
455
|
+
|
|
453
456
|
<button type="button" onClick={() => navigate('/settings')}>
|
|
454
457
|
Настройки → /dashboard/settings
|
|
455
458
|
</button>
|
|
459
|
+
|
|
456
460
|
{/* Переход вне раздела: свой base в вызове */}
|
|
457
461
|
<button type="button" onClick={() => navigate('/', { base: '' })}>
|
|
458
462
|
На главную
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/vadim_budarin/projects/use-route/node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/node_modules:/Users/vadim_budarin/projects/use-route/node_modules/.pnpm/browserslist@4.28.1/node_modules:/Users/vadim_budarin/projects/use-route/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/vadim_budarin/projects/use-route/node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/node_modules:/Users/vadim_budarin/projects/use-route/node_modules/.pnpm/browserslist@4.28.1/node_modules:/Users/vadim_budarin/projects/use-route/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/cli.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/cli.js" "$@"
|
|
21
|
+
fi
|
package/demo/package.json
CHANGED