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

vue-letter-nav

v0.1.3

Published

A Letter Nav component for Vue.js

Downloads

9

Readme

vue-letter-nav

一个基于vue的字母导航组件

demo 注:请F12,选择手机模式查看,或者本地运行在手机浏览器上的查看

使用

# 安装 npm 包
npm install -S vue-letter-nav

# 项目引入css
import "~vue-letter-nav/lib/vue-letter-nav.css";

# 项目main.js引入组件, 全局引入

import VueLetterNav from 'vue-letter-nav'

Vue.use(VueLetterNav)

构建命令


# 安装依赖
npm install

# 启动本地服务(默认localhost与ip) localhost:8080
npm run dev

# 打包示例
npm run bulid

Api

| 参数 | 描述 | 类型 | 可选值 | 必须 | 默认值 | | -- |:----: | :--: | :--: | :--: | -- | | check | 已选中的值,一维数组 | Array | | true | [] | | list | 全部的数据 | Array | [ {'alpha': 'A', name: '用户', value: 'Account'} ] | true | [] | | multiple | 是否多选 | Boolean | | false | false | | readonly | 是否只读 | Boolean | | false | false | | showLetter | 显示字母导航 | Boolean | | false | true | | scrollOptions | 滚动行为 | Object | | false |

#
list数据格式如下: {
    name: '安哥拉',
    value: 'Angola',
    alpha: 'A'
}, {
    name: '阿富汗',
    value: 'Afghanistan'
}, {
    name: '阿尔巴尼亚',
    value: 'Albania'
}, {
    name: '巴哈马',
    value: 'Bahamas',
    alpha: 'B'
}, {
    name: '巴林',
    value: 'Bahrain'
}

scrollOptions API

因为引用了 MDN: scrollIntoView(),故可参考其相关配置

| 参数 | 描述 | 类型 | 可选值 | 必须 | 默认值 | | -- |:----: | :--: | :--: | :--: | -- | | behavior | 定义滚动动画 | String | auto(自动)| instant(无滚动)| smooth(缓动)| false | auto | | block | 设置滚动指定元素位置 | String | start(顶部)| center(居中)| end(底部)| nearest(最近的)| false | center | | inline | 设置滚动指定元素位置 | String | start(顶部)| center(居中)| end(底部)| nearest(最近的)| false | center |

slot

| 参数 | 描述 | 类型 | 可选值 | 必须 | 默认值 | | -- |:----: | :--: | :--: | :--: | -- | | content | 子项内容 | | | | |

#
支持slot, 可以自定义slot子项的内容, 如下所示# data为的子项的数据, 格式: {
    name: '',
    value: ''
}

vue - letter - nav(: check = "checkList": list = "allList": multiple = "true": readonly = "false"
    @check = "handleCheck")
template(slot = "content"
    slot - scope = "{data}")
span.letter - content - icon√
span {
    {
        data.name
    }
}

更新日志

0.1.0

  1. 基础版本发布

0.1.1

  1. 增加scrollOptions配置

0.1.3

  1. 升级依赖