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-lazy-cascader

v0.2.1

Published

A cascader component based on element-ui, which retains the basic functionality of el-cascader while adding remote search and scroll loading of nodes.

Downloads

4

Readme

Vue Lazy Cascader

Vue Lazy Cascader 是一个vue2级联选择器组件,基于 element-ui 的级联组件。它保留了 el-cascader 的完整功能,并增加了滚动加载和远程搜索功能。

Install

您可以通过 npm、yarn 或 pnpm 来安装 Vue Lazy Cascader。

npm

npm install vue-lazy-cascader --save

yarn

yarn add vue-lazy-cascader

pnpm

pnpm install vue-lazy-cascader --save

Changelog

更新日志

Usage

  • es模块示例

    import VueLazyCascader from "vue-lazy-cascader";
  • 直接script引入示例

description

Added Prop

| 属性名 | 类型 | 描述 | |----------------|-----------|--------------------| | remote | boolean | 是否开启远程搜索 | | props.remoteMethod | (query: string, resolve: (any[]) => void) | 远程搜索方法,回调接收搜索的数据作为参数,会将未加载的数据插入到级联的数据store中 | | props.total | string | 指定选项子节点总数为选项对象的某个属性值,默认'total' |

Added Events

| event name | callback parameter | description | |------------------|------------------------------|--------------------------------| | menu-scroll-bottom | (parentNode: Node, resolve: (any[]) => void) | 当菜单滚动到底部时触发,回调接收滚动加载的新数据作为参数,会将传入的未加载的数据插入到级联的数据store中。 | | suggestion-scroll-bottom | (query: string, resolve: (any[]) => void) | 当搜索列表滚动到底部时触发,回调接收搜索的数据作为参数,会将未加载的数据插入到级联的数据store中。 |

Tip

  • 该组件打包了所需的element-ui组件,但是并没有引入element-ui样式,所以在使用前必须引入'element-ui/lib/theme-chalk/index.css'
  • 级联value必须唯一,否则会出错。例如相同value的子节点无法插入到不同的父节点下(待修复)
  • 是否是最后一页要判断准确,不能单纯用已加载和接口返回相加数量 == total进行判断,因为接口返回的可能已经加载过了。详情请看代码(搜索时候会把搜索结果append到节点store中)
  • pop的层级如果不对,可以将appendToBody设置为false