cec-nuxt-lib 0.4.1 → 0.4.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/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "cec-nuxt-lib",
3
3
  "configKey": "cec-nuxt-lib",
4
- "version": "0.4.1"
4
+ "version": "0.4.3"
5
5
  }
@@ -1,7 +1,10 @@
1
1
  <script setup lang="ts">
2
- import { useState } from '#app';
2
+ import { useState, useRuntimeConfig } from '#app';
3
3
  import { useRoute } from 'vue-router';
4
4
 
5
+ const config = useRuntimeConfig();
6
+ const baseUrl = config.app.baseURL;
7
+
5
8
  const classicPath = useState('classicPath');
6
9
  const route = useRoute();
7
10
 
@@ -41,10 +44,20 @@ let routes = makeArr(routeTrim);
41
44
  // Get the classic path for legacy links
42
45
  let classic = trimPath(classicPath.value).split('/');
43
46
  const length = classic.length;
44
-
45
- let hrefs = `${classicPath.value}${routeTrim === '/' ? '' : routeTrim}`.split(
46
- '/'
47
- );
47
+ let hrefs;
48
+ if (baseUrl !== '/') {
49
+ hrefs = `${classicPath.value}${routeTrim === '/' ? '' : routeTrim}`.split(
50
+ '/'
51
+ );
52
+ } else {
53
+ hrefs = routes.reduce((acc, e, i) => {
54
+ if (classic[i]) {
55
+ return [...acc, classic[i]];
56
+ } else {
57
+ return [...acc, e];
58
+ }
59
+ }, []);
60
+ }
48
61
  const links = hrefs.map((e, i) => (!i ? 'Home' : toTitleCase(e)));
49
62
  </script>
50
63
  <template>
@@ -69,7 +69,7 @@ const accordionComponent = (props: any) => {
69
69
  id="${accId}"
70
70
  type="checkbox"
71
71
  />
72
- <label for="${accId}">${e.title}</label>
72
+ <label for="${accId}">${e.accLabel}</label>
73
73
  <article>${e.content}</article>
74
74
  `;
75
75
  });
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.4.1",
2
+ "version": "0.4.3",
3
3
  "name": "cec-nuxt-lib",
4
4
  "description": "Nuxt components and assets",
5
5
  "license": "MIT",