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 🙏

© 2025 – Pkg Stats / Ryan Hefner

k2-transfer

v0.1.1

Published

基于iview Transfer的增强版穿梭框组件, 支持双击、多选、键盘操作

Readme

k2-transfer 穿梭框组件

注意:次组件依赖 iview,请确保已安装 iview

使用

npm install k2-transfer --save

使用及文档可以查看iview Transfer,该组件只是在其基础上进行增强。

新增功能

  1. [x] 支持自定义穿梭框最外层 container 样式
  2. [x] 支持双击某项来进行穿梭(如双击左栏某项,该项自动进入右栏,不需要点击中间的箭头)
  3. [x] 支持鼠标 shift 一次性多选
  4. [ ] 支持键盘操作(In progress)

API

Transfer props

兼容 iview Transfer 组件所有 API, (*) 为 K2Transfer 新增API

| 属性 | 说明 | 类型 | 默认值 | | ------------------ | ------------------------------------------------------------ | -------- | ---------------------------- | | data | 数据源,其中的数据将会被渲染到左边一栏中,targetKeys 中指定的除外。 | Array | [] | | targetKeys | 显示在右侧框数据的key集合 | Array | [] | | render-format | 每行数据渲染函数,该函数的入参为 data 中的项 | Function | 默认显示label,没有时显示key | | selected-keys | 设置哪些项应该被选中 | Array | [] | | styles (*) | 穿梭框最外层容器自定义样式 | Object | {} | | list-style | 两个穿梭框的自定义样式 | Object | {} | | titles | 标题集合,顺序从左至右 | Array | ['源列表', '目的列表'] | | operations | 操作文案集合,顺序从上至下 | Array | [] | | doubleClick (*) | 时候支持双击 | Boolean | true | | filterable | 是否显示搜索框 | Boolean | false | | filter-placeholder | 搜索框的占位 | String | 请输入搜索内容 | | filter-method | 自定义搜索函数,入参为 data 和 query,data 为项,query 为当前输入的搜索词 | Function | 默认搜索label | | not-found-text | 当列表为空时显示的内容 | String | 列表为空 |

Transfer events

| 事件名 | 说明 | 返回值 | | ------------------- | ------------------------------ | -------------------------------------- | | on-change | 选项在两栏之间转移时的回调函数 | targetKeys, direction, moveKeys | | on-dblclick (*) | 双击项时触发 | targetKeys, direction, moveKeys | | on-selected-change | 选中项发生变化时触发 | sourceSelectedKeys, targetSelectedKeys |

Transfer slot

| 名称 | 说明 | | ---- | -------------- | | 无 | 自定义底部内容 |