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

yy-org-switch

v2.0.54

Published

可下拉选择的数形组件

Readme

yy多级管控组织切换

14a6c6df-8c72-48a3-8399-884b1f6fc1ec.gif

Install

安装方法:
npm安装:
npm: npm install yy-org-switch
yarn安装:
yarn add yy-org-switch

Quick Start

<template>
<YYOrgSwitch
      @select="onSelect"
      @err="errorFunc"
      :name="nameTag"
      :id="idTag"
      :defaultText="defaultText"
      :onlyOneLevel="onlyOneLevel"
      :noSearch="noSearch"
      :canNotBeEmpty="canNotBeEmpty"
      :lang="lang"
      :yySelectDialogTitle="yySelectDialogTitle"
      />
</template>
import YYOrgSwitch from 'yy-org-switch'
...,
components: {YYOrgSwitch},
methods:{
  yyOrgSelectLoadData(parent_id) {

  }
  yyOrgSelectSearchData(keyword){

  }
  errorFunc(msg) {

  },
  onSelect(org){

  }
}

Params

  yyOrgSelectLoadData      不需要传递该方法,父组件内部要有这个函数就行,该组件会调用,用于加载树形组件的初始数据 或者 请求树形组件的下级数据,参数以parent_id传递
  yyOrgSelectSearchData    不需要传递该方法,父组件内部要有这个函数,该组件会调用,用于搜索数据, 搜索的关键字以 keyword 传递
  @select        触发最后的选择
  @err             获取到错误信息,一般以dialog弹出来
  :name           搜索出来展示的信息,一般是name, 比如:如果要展示 fileName, 就传递 'fileName'
  :id                 用在树形结构请求下级数据的,一般是id,比如:如果用fileId请求下级数据,就传递fileId
  :defaultText  展示的默认值
  :onlyOneLevel  布尔类型,树形组件是否只有一级,true是, false不是
  :noSearch  布尔类型,如果不需要搜索功能,就传true, 需要就传false,或者不传此参数
  :canNotBeEmpty  布尔类型,如果不允许input框输入,不允许显示删除按钮,(即不让用户置空输入框) 传递 true 即可
  :lang   字符串类型, 控制显示的语言类型, 不传默认就是汉语, 英语则传递 'en' 繁体传递 'zh-TW'
  :yySelectDialogTitle   字符串类型, 弹框的title
  :bg   布尔类型, 默认弹框有背景,如果不需要背景可以设置false
  :disableKey 字符串类型, checkbox 禁选key
  :hasCheck 布尔类型 默认false 是否显示checkbox
特殊说明: yyOrgSelectLoadData    yyOrgSelectSearchData  返回的结果需要是promise对象,并且resolve的结果是要展示的数组数据,示例如下:
yyOrgSelectLoadData(parentId) {
      return new Promise((resolve, reject) => {
          axios.get(url).then((res)=> {
            resolve(res.data.data.dept_list)
        })
      })
    },
 yyOrgSelectSearchData(keyword) {
      return new Promise((resolve, reject) => {
          axios.get(url).then((res)=> {
            resolve(res.data.data.dept_list)
        })
      })
    }