r3ui-lib 1.3.2 → 1.3.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/CHANGELOG.md +6 -0
- package/nuxt-errors/nuxt.config.ts +1 -1
- package/package.json +3 -1
- package/useBreadcrumbs.ts +33 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
Формат основан на [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
и этот проект придерживается [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.3.3] - 2026-09-09
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `r3ui-lib/useBreadcrumbs` — Nuxt-адаптер крошек; явный import, без копии файла и без слоя ошибок
|
|
13
|
+
|
|
8
14
|
## [1.3.2] - 2026-09-08
|
|
9
15
|
|
|
10
16
|
### Fixed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineNuxtConfig } from 'nuxt/config';
|
|
2
2
|
|
|
3
3
|
export default defineNuxtConfig({
|
|
4
|
-
// Layer
|
|
4
|
+
// Layer: extends: ['r3ui-lib/nuxt-errors'] — error.vue, plugin, utils.
|
|
5
5
|
// Runtime-зависимости (vue, nuxt) предоставляет host app.
|
|
6
6
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "r3ui-lib",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.3",
|
|
5
5
|
"description": "Modern Vue 3 UI component library with TypeScript support",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"vue",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"import": "./dist/login.es.js",
|
|
38
38
|
"require": "./dist/login.umd.js"
|
|
39
39
|
},
|
|
40
|
+
"./useBreadcrumbs": "./useBreadcrumbs.ts",
|
|
40
41
|
"./nuxt-errors": "./nuxt-errors/nuxt.config.ts",
|
|
41
42
|
"./nuxt-errors/*": "./nuxt-errors/*",
|
|
42
43
|
"./styles": "./dist/r3ui-lib.css",
|
|
@@ -46,6 +47,7 @@
|
|
|
46
47
|
"dist",
|
|
47
48
|
"assets",
|
|
48
49
|
"nuxt-errors",
|
|
50
|
+
"useBreadcrumbs.ts",
|
|
49
51
|
"README.md",
|
|
50
52
|
"LICENSE",
|
|
51
53
|
"CHANGELOG.md"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { navigateTo, useI18n, useRouter, watch } from '#imports';
|
|
2
|
+
import { useBreadcrumbs as useBreadcrumbsBase } from 'r3ui-lib';
|
|
3
|
+
|
|
4
|
+
export function useBreadcrumbs() {
|
|
5
|
+
const router = useRouter();
|
|
6
|
+
const { t } = useI18n();
|
|
7
|
+
|
|
8
|
+
const breadcrumbsComposable = useBreadcrumbsBase({
|
|
9
|
+
navigate: (path: string) => navigateTo(path),
|
|
10
|
+
translate: (key: string) => t(key),
|
|
11
|
+
getCurrentRoute: () => {
|
|
12
|
+
const route = router.currentRoute.value;
|
|
13
|
+
const name =
|
|
14
|
+
typeof route.name === 'string' && route.name ? route.name : 'home';
|
|
15
|
+
return { path: route.path, name };
|
|
16
|
+
},
|
|
17
|
+
maxItems: 5,
|
|
18
|
+
storageKey: 'breadcrumbs',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
watch(
|
|
22
|
+
() => {
|
|
23
|
+
const route = router.currentRoute.value;
|
|
24
|
+
const name = typeof route.name === 'string' ? route.name : '';
|
|
25
|
+
return `${route.path}\0${name}`;
|
|
26
|
+
},
|
|
27
|
+
() => {
|
|
28
|
+
breadcrumbsComposable.updateBreadcrumbs();
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
return breadcrumbsComposable;
|
|
33
|
+
}
|