inicios del FrontEnd

This commit is contained in:
2021-04-21 21:47:04 -05:00
parent 4a7fb24eb2
commit cf9505f26d
196 changed files with 28978 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
<template>
<ul class="breadcrumb" :class="{ 'bg-transparent': transparent }">
<slot></slot>
</ul>
</template>
<script>
export default {
name: 'breadcrumb',
props: {
transparent: {
type: Boolean,
default: true
}
}
};
</script>
<style></style>

View File

@@ -0,0 +1,16 @@
<template>
<li class="breadcrumb-item" :class="{ active: active }"><slot></slot></li>
</template>
<script>
export default {
name: 'breadcrumb-item',
props: {
active: {
type: Boolean,
default: false,
description: 'Whether breadcrumb item is active'
}
}
};
</script>
<style></style>

View File

@@ -0,0 +1,48 @@
<template>
<bread-crumb>
<BreadCrumbItem
v-for="(route, index) in $route.matched.slice()"
:key="route.name"
style="display:inline-block"
>
<nuxt-link
:to="{ name: route.name }"
v-if="index < $route.matched.length - 1"
class="breadcrumb-link"
>
{{ routeName }}
</nuxt-link>
<span v-else class="breadcrumb-current">{{ routeName }}</span>
</BreadCrumbItem>
</bread-crumb>
</template>
<script>
import BreadCrumb from './Breadcrumb';
import BreadCrumbItem from './BreadcrumbItem';
export default {
name: 'route-breadcrumb',
components: {
BreadCrumb,
BreadCrumbItem
},
computed: {
routeName() {
const { path } = this.$route;
let parts = path.split('/')
return parts.map(p => this.capitalizeFirstLetter(p)).join(' ');
}
},
methods: {
capitalizeFirstLetter(string) {
if (!string || typeof string !== 'string') {
return ''
}
return string.charAt(0).toUpperCase() + string.slice(1);
}
}
};
</script>
<style scoped></style>