npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bread-crumbs-dl

v1.0.1

Published

Bread crumbs en [vivo](https://codepen.io/JOSEJUAN/pen/OJMVYJW)

Downloads

3

Readme

bread-crumbs-dl

Bread crumbs en vivo

Este es un componente para ser usado como bread-crumbs en las aplicaciones sin embargo el también se presta para usarse en la representación de flujos unidireccionales o en líneas de tiempo.

Install

npm i bread-crumbs-dl

Use

Uso global en la aplicación con el nombre bread-crumbs-dl:

main.js

import { install } from 'bread-crumbs-dl';

Vue.use(install);
...
...
new Vue({
    el: '...'
})

o si quieres cambiarle el nombre al componente:

import breadCrumbsDl from 'bread-crumbs-dl';

Vue.component('my-component-name', breadCrumbsDl)
...
...
new Vue({
    el: '...'
})

Luego, en cualquier archivo .vue puede ser usado.

<template>
    <bread-crumbs-dl />
</template>

Si prefieres importar el archivo directamente en el archivo en el que lo usarás, por ejemplor en cualquierArchivo.vue:

<template>
    <bread-crumbs-dl />
</template>
import BreadCrumbsDl from 'bread-crumbs-dl';

export default {
    components: {
        breadCrumbsDl: BreadCrumbsDl,
    }
}

Cómo usarlo

El componente tiene las siguientes propiedades: Nombre|Tipo|Valores|Descripción| :-----|:---|:------|:----------| text|String| cualquiera|Es el contenido mostrado en el componente. Por defecto: '' color|String|#f9f9f9|Corresponde al color de fondo del componente. Por defecto currentColor. color-text|String|#000000|Corresponde al color del texto en el componente. Por defecto white.

Es importante definir ciertos estilos para el componente como: ancho automático y el alto definido. La primera propiedad es necesaria para que el componente se ajuste de acuerdo al texto a mostrar. La tercera propiedad importante es el margin-right para que separe los componentes. Es posible asignar los colores por estilos y no directamente en las propiedades:

<bc-dl
    v-for="(route, index) in routes"
    :key="index"
    :class="[
    'bc-dl-container',
    { 'selected': index === routes.length - 1 }
    ]"
    :text="route.meta.title"
    @click="handler(route)"
/>
.bc-dl-container.bc-container {
    @apply w-auto h-20 mr-2 my-1;
    @apply cursor-pointer;
    .bc-svg {
      fill: rgb(76, 128, 224);
      .bc-text {
        @apply text-2xl font-bold;
      }
    }
  }
  .selected.bc-container {
    .bc-svg {
      fill: rgb(50, 231, 50);
    }
  }

bc.container: es la clase principal del componente usada para acceder a las clases de los elementos internos.

.bc-svg: es la clase del elemento svg y se usa para asignar el valor a fill

.bc-text: es la clase del elemento <text> encargado de renderizar el texto.

Adicionalmente se puede escuchar el evento @click en el componente

<template>
    <bread-crumbs-dl @click="clickHandler"/>
</template>