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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@beisen-phoenix/transfer

v3.3.55

Published

#### API 属性如下:

Readme

穿梭框

API 属性如下:

| 成员 | 说明 | 类型 | 默认值 | | ----------------- | :-----------------------------------------------------------------------: | :--------------------------------------------: | ---------- | | canDrag | 是否可拖拽 | boolean | false | | titles | 标题集合,顺序从左至右 | string[] | ['', ''] | | showSearch | 是否显示搜索框 | boolean | false | | leastCount | 设置最少选择几条 | number | - | | searchPlaceholder | 搜索框 placeholder 内容 | string | '请搜索' | | notFoundContent | 无数据时展示内容 | string, React.ReactNode | '暂无数据' | | width | 自定义宽度 | string | - | | height | 自定义高度 | string | - | | dataSource | 穿梭框数据(type 在 group 模式下数据结构有些不同,具体见下方 TransferItem) | TransferItem[] | [] | | targetKeys | 显示在右侧数据的 key 集合 | string[] | [] | | selectedKeys | 设置哪些项应该被选中 | string[] | [] | | type | 类型 | string(“group” / "normal") | normal | | lazy | 使用 react-lazy-load 优化性能,可参照 react-lazy-load 设置相关参数 | - | | onChange | 选项在两栏之间转移时的回调函数 | (targetKeys, direction, moveKeys): void | | onSelectChange | 选中项发生改变时的回调函数 | (sourceSelectedKeys, targetSelectedKeys): void | - | | onSearch | 搜索框内容时改变时的回调函数 | (direction: 'left', value: string): void | - | | onScroll | 选项列表滚动时的回调函数 | (direction, event): void | - | | onDragChange | 选项拖拽时的回调函数 | (dataSource, targetkeys): void | - |

changelog

2019/10/28 1、新增 type 属性(“group”|“normal”) 2、新增左侧选择支持分组(目前仅支持一级分组) 3、删除 rowKey 属性 4、删除 dataSource 里的 value 属性,key 属性为必填(key 就是 value) 5、type 为 group 的时候,dataSource 的数据结构

注意:

按照 React 的规范,所有的组件数组必须绑定 key。在 Transfer 中,dataSource 里的数据值需要指定 key 值。对于 dataSource 默认将每列数据的 key 属性作为唯一的标识。

如果你的数据没有这个属性,务必使用 rowKey 来指定数据列的主键。

// 比如你的数据主键是 uid
return <Transfer rowKey={record => record.uid} />;

TransferItem 类型

//当type为normal或者不传的时候
const dataSource = [{
    key: ‘12345’,
    title: '测试1',
    disabled: false
}]
//当type为group当时候
const dataSource =[{
    key:"groupKey",
    title:"groupTitle",
    children:[{
        key:"12345",
        title:"名称",
        disabled:false
    }]
}]