@shwfed/nuxt 0.11.33 → 0.11.34

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
3
  "configKey": "shwfed",
4
- "version": "0.11.33",
4
+ "version": "0.11.34",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -11,40 +11,8 @@ export function useNavigationTabs(navigations) {
11
11
  const clean = (path) => path.replace(/\/$/g, "");
12
12
  const route = useRoute();
13
13
  const router = useRouter();
14
- const has = (raw) => {
15
- const path = clean(raw);
16
- for (const group of toValue(navigations)) {
17
- if ("children" in group) {
18
- for (const item of group.children) {
19
- if (item.route === path) {
20
- return true;
21
- }
22
- }
23
- } else {
24
- if (group.route === path) {
25
- return true;
26
- }
27
- }
28
- }
29
- };
30
14
  onMounted(() => {
31
15
  const path = clean(route.path);
32
- if (!has(path)) {
33
- const [first] = Array.from(tabs.value);
34
- if (first) {
35
- active.value = first;
36
- router.replace(first);
37
- return;
38
- }
39
- const nav = toValue(navigations)[0];
40
- const fallback = nav && "children" in nav ? nav.children[0]?.route : nav?.route;
41
- if (fallback) {
42
- router.replace(fallback);
43
- active.value = fallback;
44
- tabs.value.add(fallback);
45
- }
46
- return;
47
- }
48
16
  if (!tabs.value.has(path))
49
17
  tabs.value.add(path);
50
18
  active.value = path;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
- "version": "0.11.33",
3
+ "version": "0.11.34",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "type": "module",