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

@aligov/tag-input

v1.2.1

Published

多标签输入框 用于多个字符串输入

Downloads

122

Readme

标签输入框

@aligov/tag-input

多标签输入框,用于多个字符串输入

外观是普通的输入框,但输入内容后按回车展示为一个个的 tag,支持按指定的标识符来分割成一个个 tag,并做去重操作。

最底层实现是 Fusion Select 组件的 tag 模式,其 dataSource 是空数组,除明确指定的参数外,其余参数会透出给 Select 组件。

API

| 参数名 | 说明 | 必填 | 类型 | 默认值 | 备注 | | | ------------ | ---------------- | ---- | ------------------------------ | ------ | ---- | | | defaultValue | 非受控模式 value | 否 | Array | | | | | value | 受控模式 value | 否 | Array | | | | | separator | 分隔符 | 否 | String 或 Array | | | | | onChange | 输入回调 | 否 | (value: Array) => void | | | | | className | 扩展类名 | 否 | string | "" | | | | style | style | 否 | object | {} | | |

separator 用于在按 Enter 键录入内容时,根据该指定的字符串来把最新录入的字符串拆分成多个,会移除分隔后前后的空格。 如输入 1,2, 3 , 45 后,按 Enter,获取到的值中新增了 12345。然后再和已有的数组来做合并以及去重。

separator 可以是 string 或者 Array,后者特别得可以用于同时支持中英文符合分隔得情况。