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

v1.3.16

Published

支持虚拟滚动的vue2版本的cascader

Downloads

10

Readme

介绍

基于element-uivue-virtual-scroller实现的支持虚拟滚动的级联选择器(vue2),主体样式和功能对齐OKee,支持大数据渲染场景,增加支持全选功能。

install

npm i vue-virtual-cascader --save
# or
yarn add vue-virtual-cascader

全局使用

import vueVirtualCascader from 'vue-virtual-cascader';
import 'vue-virtual-cascader/dist/vue-virtual-cascader.css';

Vue.use(vueVirtualCascader);

局部使用

<template>
  <div id="app">
    <VirtualCascader v-model="value" :props="props" :options="options" size="mini" collapse-tags filterable clearable />
  </div>
</template>
<script>
import Cascader from 'vue-virtual-cascader/dist/vue-virtual-cascader.umd.min.js';
import 'vue-virtual-cascader/dist/vue-virtual-cascader.css';
const { VirtualCascader } = Cascader;

export default {
  components: {
    VirtualCascader
  },
}
</script>

新增功能

除了Element带的功能和属性外,为了更好的扩展,新增支持一些插槽:

| 名称 | 说明 | | --- | --- | | prefix | 输入框头部内容 | | suffix | 输入框尾部内容 | | default | 自定义备选项的节点内容,参数为 { node, data },分别为当前节点的 Node 对象和数据 |

说明

由于是基于element,所以很多参数也是以element为主,okee为辅(样式以okee为主),所以参数请参考element文档,常用样式说明如下:

| Okee中名称 | ele中名称 | 说明 | | --- | --- | --- | | multiple | props -> multiple | ele中多选时props中的参数,不是直接绑定在组件上 | | independent | props -> checkStrictly | ele中独立模式也是在props中,并且属性名有变化 |

主题定制

为了更好的扩展,组件主要样式使用css变量开发,暴露变量包括:

/* 组件主题色 */
--theme-color: #1251ff;
/* 组件边框颜色 */
--border-color: #e9e9ed;
/* 组件文本颜色 */
--txt-color: #323335;