cec-nuxt-lib 0.3.10 → 0.3.12

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.3.10"
4
+ "version": "0.3.12"
5
5
  }
@@ -9,9 +9,14 @@ const path = useState('path');
9
9
  const route = useRoute();
10
10
  const baseUrl = config.app.baseURL;
11
11
 
12
+ const trimPath = (str) => str && str.replace(/\/$/, '');
13
+ let baseLength = baseUrl ? trimPath(baseUrl).split('/').length : 0;
14
+
12
15
  // Helper functions
13
16
  const makeLink = (i, routes) => {
14
- return routes.slice(0, i + 1).join('/');
17
+ i = baseUrl ? baseLength - 1 : i + 1;
18
+ let l = routes.slice(0, i).join('/');
19
+ return l === '' ? '/' : l;
15
20
  };
16
21
 
17
22
  const toTitleCase = (str) => {
@@ -29,13 +34,12 @@ const makeArr = (str) => {
29
34
  }, []);
30
35
  };
31
36
 
32
- const trimPath = (str) => str.replace(/\/$/, '');
33
-
34
37
  // Make arrays of the items in the paths
35
38
  let routeTrim = trimPath(route.path);
36
39
  let pathTrim = trimPath(path.value);
37
40
  let routes = makeArr(routeTrim);
38
41
  let paths = makeArr(pathTrim);
42
+ //console.log(routes)
39
43
 
40
44
  // Use the route path if it includes the node's path
41
45
  if (!routeTrim.toLowerCase().startsWith(pathTrim.toLowerCase())) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.3.10",
2
+ "version": "0.3.12",
3
3
  "name": "cec-nuxt-lib",
4
4
  "description": "Nuxt components and assets",
5
5
  "license": "MIT",