cec-nuxt-lib 0.1.3 → 0.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/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "cec-vue-lib",
3
3
  "configKey": "cec-vue-lib",
4
- "version": "0.1.3"
4
+ "version": "0.1.4"
5
5
  }
@@ -1,14 +1,23 @@
1
1
  <script setup lang="ts">
2
2
  import { useState } from '#app';
3
+ import { useRuntimeConfig } from '#app';
3
4
  import { useRoute } from 'vue-router';
4
5
 
5
- const classicPath = useState('classicPath');
6
+ const config = useRuntimeConfig();
6
7
  const route = useRoute();
7
- let length = classicPath.value.split('/').length - 1;
8
8
 
9
- const truePath =
10
- route.path === '/' ? classicPath.value : classicPath.value + route.path;
9
+ const baseUrl = config.app.baseURL;
10
+ const classicPath = useState('classicPath');
11
+ const path = useState('path');
12
+
13
+ // Used to make the Nuxt links
11
14
  let routes = route.path.split('/');
15
+ const length = path.value.split('/').length - 1;
16
+
17
+ let truePath = classicPath.value;
18
+ if (baseUrl && route.path !== '/') {
19
+ truePath += route.path;
20
+ }
12
21
 
13
22
  const makeLink = (i) => {
14
23
  let diff = i - length;
@@ -29,7 +38,7 @@ const toTitleCase = (str) => {
29
38
  };
30
39
 
31
40
  let hrefs = truePath === '/' ? [''] : truePath.split('/');
32
- const links = hrefs.map((e, i) => (!e ? 'Home' : toTitleCase(e)));
41
+ const links = hrefs.map((e, i) => (!i ? 'Home' : toTitleCase(e)));
33
42
  </script>
34
43
  <template>
35
44
  <div class="cec-breadcrumb-bg">
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.3",
2
+ "version": "0.1.4",
3
3
  "name": "cec-nuxt-lib",
4
4
  "description": "Nuxt components and assets",
5
5
  "license": "MIT",