cec-nuxt-lib 0.1.6 → 0.1.7

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.6"
4
+ "version": "0.1.7"
5
5
  }
@@ -9,12 +9,8 @@ const classicPath = useState('classicPath');
9
9
  const baseUrl = config.app.baseURL;
10
10
 
11
11
  // Helper functions
12
- const makeLink = (i) => {
13
- let diff = i - length;
14
- if (!diff) {
15
- return '/';
16
- }
17
- return routes.slice(0, diff + 1).join('/');
12
+ const makeLink = (i, routes) => {
13
+ return routes.slice(0, i + 1).join('/');
18
14
  };
19
15
 
20
16
  const toTitleCase = (str) => {
@@ -32,7 +28,7 @@ let routes = route.path
32
28
  let classic = classicPath.value
33
29
  .split('/')
34
30
  .filter((e, i) => !(i === cLength - 1 && !e.length));
35
- const length = classic.length - 1;
31
+ const length = classic.length;
36
32
  let hrefs =
37
33
  baseUrl.length > 1 && route.path !== '/'
38
34
  ? `${classicPath.value}${route.path}`.split('/')
@@ -51,9 +47,9 @@ const links = hrefs.map((e, i) => (!i ? 'Home' : toTitleCase(e)));
51
47
  <ol class="breadcrumb cec-breadcrumb my-0 py-2">
52
48
  <li class="breadcrumb-item" v-for="(l, i) in links" :key="i">
53
49
  <span v-if="i === links.length - 1">{{ l }}</span>
54
- <NuxtLink v-else-if="i >= length" :to="makeLink(i)">
55
- {{ l }}</NuxtLink
56
- >
50
+ <template v-else-if="i + 1 >= length">
51
+ <NuxtLink :to="makeLink(i, routes)">{{ l }} nuxt</NuxtLink>
52
+ </template>
57
53
  <a v-else :href="'/' + hrefs.slice(1, i + 1).join('/')">
58
54
  {{ l }}</a
59
55
  >
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.6",
2
+ "version": "0.1.7",
3
3
  "name": "cec-nuxt-lib",
4
4
  "description": "Nuxt components and assets",
5
5
  "license": "MIT",