cec-nuxt-lib 0.2.0 → 0.2.2

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