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

@yinta/common-multiple-select

v1.0.1

Published

公共多选下拉框组件

Downloads

3

Readme

UI2.0 多选下拉框

功能介绍

基于 el-select 进行二次封装,保留了之前的基础功能,并额外新增了以下几大功能:

  • 支持全选
  • 支持单选某一项取消其他项的选择
  • 支持确定取消功能
  • 支持本地筛选
  • 支持远程搜索
  • 支持 shift 多选
  • 支持 collapse-tags 折叠

引入说明

  1. 安装组件 npm install @yinta/common-multiple-select
  2. 代码位置:https://git.yintaerp.com/yinta-fed/yinta-fed-docs/-/tree/dev/components/common/MultipleSelect
  3. 如果过程中有什么问题,可以在这个公共的 git 仓库中提交修改。

在 vue.config.js 中加入配置以便能进行 babel 编译

module.exports = {
  transpileDependencies: ['@yinta/common-multiple-select'],
};
// 引入
import MultipleSelect from '@yinta/common-multiple-select';
// 注册
export default {
  components: {
    MultipleSelect,
  },
};

使用例子

<template>
  <div style="padding: 16px">
    <el-card>
      <!--默认自带筛选功能,传入 remote 参数,则需监听 searchChange 事件,从接口拿 options 配置-->
      <common-multiple-select
        v-model="selectedIds"
        :options="selectOptions"
        collapse-tags
        @change="handleChange"
        @search-change="handleSearch"
      />
    </el-card>
  </div>
</template>
 <script>
import CommonMultipleSelect from './common-multiple-select'

export default {
  components: {
    CommonMultipleSelect
  },
  data() {
    return {
      selectedIds: ['选项1'],
      selectOptions: [
        {
          value: '选项1',
          label: '黄金糕1'
        },
        {
          value: '选项2',
          label: '双皮奶1'
        },
        {
          value: '选项3',
          label: '蚵仔煎1'
        }
      ]
    }
  },
  methods: {
    handleSearch(val) {
      console.log(val)
    },
    handleChange(val) {
      console.log(val)
    }
  }
}
</script>

Select Attributes

| 参数 | 说明 | 类型 | 可选值 | 默认值 | | ------------- | ---------------------------------- | ------- | ------ | ------ | | v-model | 绑定值 | Array | | 无 | | options | 下拉选项 | Array | | 无 | | collapse-tags | 多选时是否将选中值按文字的形式展示 | boolean | | false | | remote | 是否为远程搜索 | boolean | | false |

Select Events

| 事件名称 | 说明 | 类型 | | ------------- | ----------------------- | ------------ | | change | 选中值发生变化时触发 | 目前的选中值 | | search-change | remote 模式下,筛选回调 | 搜索关键词 |