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

xm-select

v0.0.3

Published

始于Layui的select多选解决方案

Readme

xm-select

介绍

始于Layui, 下拉选择框的多选解决方案

前身前往formSelectes, 由于渲染速度慢, 代码冗余, 被放弃了

xm-select使用了新的开发方式, 利用preact进行渲染, 大幅度提高渲染速度, 并且可以灵活拓展

xm-select演示站点

支持功能

  • [x] 国际化 - 中文/英文
  • [x] 多选
  • [x] 单选
  • [x] 重复选
  • [x] 分组
  • [x] 工具条
  • [x] 创建条目
  • [x] 显示模式
  • [x] 搜索模式 (本地数据过滤, 远程搜索)
  • [x] 分页模式
  • [x] 下拉树
  • [x] 下拉任意 - 可以自己写html

联系方式

  • xm-select技术群①: 660408068 (500人)
  • xm-select技术群②: 938624691 (500人)
  • xm-select技术群③: 1145047250 (500人)

issues 需求记录

更新日志

软件架构

  1. 引入第三方preact库, 利用jsx渲染页面结构
  2. 使用webpack进行打包

快读上手

直接使用

1. 引入 `dist/xm-select.js`
2. 写一个`<div id="demo1"></div>`
3. 渲染
	var demo1 = xmSelect.render({
		el: '#demo1', 
		data: [
			{name: '水果', value: 1, selected: true, disabled: true},
			{name: '蔬菜', value: 2, selected: true},
			{name: '桌子', value: 3, disabled: true},
			{name: '北京', value: 4},
		],
   })

二次开发

1. git clone https://gitee.com/maplemei/xm-select.git
2. cd xm-select
3. yarn 或者 npm install

目录结构说明

打赏

如果喜欢作者的插件, 可以请作者吃雪糕 ^_^

示例

示例页面

一个小栗子

<!-- 占位 -->
<div id="demo1"></div>


<!-- 引入插件 -->
<script src="../dist/xm-select.js" type="text/javascript" charset="utf-8"></script>
<!-- 渲染页面 -->
<script type="text/javascript">
	var demo1 = xmSelect.render({
		// 这里绑定css选择器
		el: '#demo1', 
		// 渲染的数据
		data: [
			{name: '水果', value: 1, selected: true, disabled: true},
			{name: '蔬菜', value: 2, selected: true},
			{name: '桌子', value: 3, disabled: true},
			{name: '北京', value: 4},
		],
	})
	
	// 变量, demo1 可以通过API操作
	// 获取选中值, demo1.getValue();
	// 设置选中值, demo1.setValue([{ name: '动态值', value: 999 }])
	// ...
</script>

相关

支持IE吗

简单适配IE10以上的版本, 如有其它兼容性问题, 请加群反馈

为什么没有css文件

已经内置到js代码中了, 直接引入xm-select.js即可使用

开源 != 无私

有问题请自己多动手尝试^_^

成长之路

maplemei, 一个90后, 热爱前端的程序猿

16年接触了 贤心大大 的 layui, 开始走向了前端的不归之路
17年尝试自己写了一个基于layui的省市区联动插件, 同年底开发了layui select多选第一版
18年6月发布了formSelects
19年6月发布了xm-select

其实每个版本的更新都是自己对前端的一个新的认知, 也是一个新的学习之路

目前作者几乎不怎么使用layui, 已经走向了vue, react的新途 , xm-select的维护是对layui的一种情怀 ^_^