@tak-ps/vue-tabler 2.4.0 → 2.5.0
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/CHANGELOG.md +4 -0
- package/components/BreadCrumb.vue +31 -0
- package/lib.js +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ol class="breadcrumb" aria-label="breadcrumbs">
|
|
3
|
+
<li class="breadcrumb-item"><a @click='$router.push("/")' class='cursor-pointer'>Home</a></li>
|
|
4
|
+
<li
|
|
5
|
+
:key='crumb_it'
|
|
6
|
+
v-for='(crumb, crumb_it) in crumbs'
|
|
7
|
+
class="breadcrumb-item"
|
|
8
|
+
:class='{
|
|
9
|
+
"active": crumb_it === crumbs.length - 1
|
|
10
|
+
}'
|
|
11
|
+
>
|
|
12
|
+
<a v-if='crumb_it === crumbs.length - 1' v-text='crumb'></a>
|
|
13
|
+
<a v-else @click='$router.push("/" + crumbs.splice(0, crumb_it + 1).join("/").toLowerCase())' class='cursor-pointer' v-text='crumb'></a>
|
|
14
|
+
</li>
|
|
15
|
+
</ol>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
export default {
|
|
20
|
+
name: 'BreadCrumb',
|
|
21
|
+
data: function() {
|
|
22
|
+
return {
|
|
23
|
+
crumbs: this.$route.path.split('/').filter((crumb) => {
|
|
24
|
+
return crumb.length;
|
|
25
|
+
}).map((crumb) => {
|
|
26
|
+
return `${crumb[0].toUpperCase()}${crumb.slice(1, crumb.length)}`;
|
|
27
|
+
})
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
</script>
|
package/lib.js
CHANGED
|
@@ -6,8 +6,10 @@ import TablerProgress from './components/Progress.vue'
|
|
|
6
6
|
import TablerLoading from './components/Loading.vue'
|
|
7
7
|
import TablerToggle from './components/Toggle.vue'
|
|
8
8
|
import TablerInput from './components/Input.vue'
|
|
9
|
+
import TablerBreadCrumb from './components/BreadCrumb.vue';
|
|
9
10
|
|
|
10
11
|
export {
|
|
12
|
+
TablerBreadCrumb,
|
|
11
13
|
TablerError,
|
|
12
14
|
TablerSelect,
|
|
13
15
|
TablerLoading,
|