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

bcm

v0.1.2

Published

![version](https://img.shields.io/badge/version-0.1.2-blue.svg?cacheSeconds=2592000)

Downloads

7

Readme

Bread Crumb Menu 👋

version

安装

npm install bcm -g
// OR
yarn global add bcm

使用

bcm init // 初始化面包屑组件
bcm new  // 新增页面文件
bcm show // 显示面包屑的配置

在需要渲染面包屑的地方引入组件

<template>
  <dp-bread-crumb />
</template>

<script>
  import DpBreadCrumb from './components/breadcrumb/dp-bread-crumb.vue'

  export default {
    components: {
      DpBreadCrumb
    }
  }
</script>

init 命令使用说明

执行 init 命令会将组件文件以及 json 文件复制到 src/components/breadcrumb 目录,此时的 json 文件内容为

[
  {
    "name": "首页",
    "path": "/"
  }
]

new 命令使用说明

在使用 new 命令时,会问 4 个问题

  1. 存放目录,即为新建的目录或页面的存放位置
  2. 目录名,即为新增页面所在的目录,不填则直接在存放目录里,也可以输入多级目录,如 aaa/bbb
  3. 文件名, 即为页面的文件名称
  4. 中文名,为面包屑上显示的中文文字

例子

安装 bcm

yarn global add bcm

使用 @vue/cli 创建一个新的 Vue 项目

vue create my-vue-project

选择 vue-router

router

运行初始化命令

bcm init

router

App.vue 中引入组件

运行项目,此时页面上的面包屑渲染为

render

新增业务页面

render render render

bcm show

此时 dp-bread-crumb.json

[
  {
    "name": "首页",
    "path": "/"
  },
  {
    "name": "产品",
    "path": "/product"
  },
  {
    "name": "产品详情",
    "path": "/product/detail"
  },
  {
    "name": "新增产品",
    "path": "/product/detail/new"
  }
]

router.js 新增路由配置

{
  path: '/productt',
  component: Product
},
{
  path: '/product/detail',
  component: Detail
},
{
  path: '/product/detail/new',
  component: New
},

面包屑渲染为

render

Contributing

  1. Fork it (https://github.com/xrr2016/bread-crumb-menu.git)
  2. Create your feature branch (git checkout -b feat/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

License

MIT

Show your support

Give a ⭐️ if this project helped you!


This README was generated with ❤️ by readme-md-generator