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

@sixi/transfer

v1.0.4

Published

级联穿梭框

Readme

transfer 级联穿梭框

通过穿梭框级联选择多个值,返回最终的值。相比于普通穿梭框,它拥有级联功能,相比于级联下拉,它支持多选且结果更直观。

何时使用

数据具有层级关系,同层的每个数据具有唯一值。

代码演示

下面是一个典型的省市区的示例:

<template>
  <transfer v-model="selectedData" :options="area" :boxTitle="['省份', '城市', '地区']" selectedTitle="已选省市区" :level="3" />
</template>
<script>
export default {
  data () {
    return {
      area: [{ 'label': '福建省', 'value': '227', 'children': [{ 'label': '厦门市', 'value': '228', 'children': [{ 'label': '思明区', 'value': '229' }, { 'label': '湖里区', 'value': '230' }, { 'label': '集美区', 'value': '231' }, { 'label': '海沧区', 'value': '232' }, { 'label': '翔安区', 'value': '233' }, { 'label': '同安区', 'value': '234' }] }] }],
      selectedData: ['227,228,230']
    }
  }
}
</script>

可以看出,选项options是一个嵌套的数组,具有label,value和children三个属性, 已选值可以使用v-model进行双向绑定,绑定的值是一个字符串数组,每个元素是用逗号分割的值,每个元素的逗号分割的值的数量应和指定的level相同,否则返回结果将会异常。

API

| 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | options | 级联选项值 | Object[] | [] | | value(v-model) | 初始化已选的值 | String[] | [] | | titles | 级联穿梭的标题 | String[] | ['1级', '2级', '3级',...] | | selectedTitle | 已选结果的标题 | String | 已选 | | level | 级联穿梭的级数 | Number | 1 |

事件

| 事件名称 | 说明 | 回调参数 | | :--- | :--- | :--- | | change | 操作变更后返回的值 | function(selected, selectedList) |